Low limit setting for a special sensor.

        For LS-10/LS-20 base units this is the alarm low limit.
        For LS-30 base units, this is either alarm OR control low limit,
        as indicated by special_status ControlAlarm bit flag.
483837
def low_limit(self) -> Optional[Union[int, float]]:
        
        return self._get_field_value(SpecialDevice.PROP_LOW_LIMIT)
714990
def set_level(self, val):
        """"""
        if val == 0:
            self.off()
        else:
            setlevel = 255
            if val < 1:
                setlevel = val * 100
            elif val <= 0xff:
                setlevel = val
            set_command = StandardSend(
                self._address, COMMAND_LIGHT_ON_0X11_NONE, cmd2=setlevel)
            self._send_method(set_command, self._on_message_received)
936032
def set_ylimits(self, min=None, max=None):
        
        self.limits['ymin'] = min
        self.limits['ymax'] = max
1241194
def setDetectionLimitOperand(self, value):
        
        manual_dl = self.getAllowManualDetectionLimit()
        selector = self.getDetectionLimitSelector()
        if not manual_dl and not selector:
            # Don't allow the user to set the limit operand if manual assignment
            # is not allowed and selector is not visible
            return

        # Changing the detection limit operand has a side effect on the result
        result = self.getResult()
        if value in [LDL, UDL]:
            # flush uncertainty
            self.setUncertainty("")

            # If no previous result or user is not allowed to manually set the
            # the detection limit, override the result with default LDL/UDL
            has_result = api.is_floatable(result)
            if not has_result or not manual_dl:
                # set the result according to the system default UDL/LDL values
                if value == LDL:
                    result = self.getLowerDetectionLimit()
                else:
                    result = self.getUpperDetectionLimit()

        else:
            value = ""
            # Restore the DetectionLimitSelector, cause maybe its visibility
            # was changed because allow manual detection limit was enabled and
            # the user set a result with "<" or ">"
            if manual_dl:
                service = self.getAnalysisService()
                selector = service.getDetectionLimitSelector()
                self.setDetectionLimitSelector(selector)

        # Set the result
        self.getField("Result").set(self, result)

        # Set the detection limit to the field
        self.getField("DetectionLimitOperand").set(self, value)
168885
def getSensorLimits(self):
        
        limits = []
        for i in range(len([b for b in self.env.case.buses if b.type == PQ])):
            limits.append((0.0, self.env._Pd0[i]))

        logger.info("Sensor limits: %s" % limits)

        return limits
728316
def set_interrupt_limits(self, low, high):
        
        self.i2c.write8(0x04, low & 0xFF)
        self.i2c.write8(0x05, low >> 8)
        self.i2c.write8(0x06, high & 0xFF)
        self.i2c.write8(0x07, high >> 8)
1342434
def SetMaxPowerUpCurrent(self, i):
        
        if i < 0 or i > 8:
            raise MonsoonError(("Target max current %sA, is out of acceptable "
                                "range [0, 8].") % i)
        val = 1023 - int((i / 8) * 1023)
        self._SendStruct("BBB", 0x01, 0x08, val & 0xff)
        self._SendStruct("BBB", 0x01, 0x09, val >> 8)
915752
def getLowerDetectionLimit(self):
        
        if self.isLowerDetectionLimit():
            result = self.getResult()
            try:
                # in this case, the result itself is the LDL.
                return float(result)
            except (TypeError, ValueError):
                logger.warn("The result for the analysis %s is a lower "
                            "detection limit, but not floatable: '%s'. "
                            "Returnig AS's default LDL." %
                            (self.id, result))
        return AbstractBaseAnalysis.getLowerDetectionLimit(self)
858916
def set_value(self, value, status=Sensor.NOMINAL, timestamp=None):
        """"""
        if timestamp is None:
            timestamp = self._manager.time()
        self.set(timestamp, status, value)
858565
def set_seccomp?
      # TODO: handle SECCOMP_MODE_SET_STRICT / SECCOMP_MODE_STRICT
      return true if number == abi[:SYS_seccomp] && args[0] == Const::BPF::SECCOMP_SET_MODE_FILTER

      number == abi[:SYS_prctl] && args[0] == Const::BPF::PR_SET_SECCOMP && args[1] == Const::BPF::SECCOMP_MODE_FILTER
    end
1493
def ylim(self, low, high):
        
        self.chart['yAxis'][0]['min'] = low
        self.chart['yAxis'][0]['max'] = high
        return self
1086776
def set_current_limit(self, channel, value, unit='A'):
        '''
        '''
        # TODO: add units / calibration
        if unit == 'raw':
            value = value
        elif unit == 'A':
            value = int(value * 1000 * self.CURRENT_LIMIT_GAIN)
        elif unit == 'mA':
            value = int(value * self.CURRENT_LIMIT_GAIN)
        elif unit == 'uA':
            value = int(value / 1000 * self.CURRENT_LIMIT_GAIN)
        else:
            raise TypeError("Invalid unit type.")

        I2cAnalogChannel._set_dac_value(self, address=self.CURRENT_LIMIT_DAC_SLAVE_ADD, dac_ch=self.CURRENT_LIMIT_DAC_CH, value=value)
1283834
def limit_current(self, curr):
        """"""
        if curr <= 0:
            raise ValueError("Current limit must be a positive number. You provided: %s" % str(curr))
        current = int(curr * (1024.0 / 5.0) * (66.0 / 1000.0))
        self._set_as_int(Addr.CurrentLimit, current, 2)
813047
def toggle_sensor(request, sensorname):
    
    if service.read_only:
        service.logger.warning("Could not perform operation: read only mode enabled")
        raise Http404
    source = request.GET.get('source', 'main')
    sensor = service.system.namespace[sensorname]
    sensor.status = not sensor.status
    service.system.flush()
    return HttpResponseRedirect(reverse(source))
1011441
def set_(device, **kwargs):
    '''
    
    '''
    empty = {'block-soft-limit': 0, 'block-hard-limit': 0,
             'file-soft-limit': 0, 'file-hard-limit': 0}

    current = None
    cmd = 'setquota'
    if 'user' in kwargs:
        cmd += ' -u {0} '.format(kwargs['user'])
        parsed = _parse_quota(device, '-u')
        if kwargs['user'] in parsed:
            current = parsed['Users'][kwargs['user']]
        else:
            current = empty
        ret = 'User: {0}'.format(kwargs['user'])

    if 'group' in kwargs:
        if 'user' in kwargs:
            raise SaltInvocationError(
                'Please specify a user or group, not both.'
            )
        cmd += ' -g {0} '.format(kwargs['group'])
        parsed = _parse_quota(device, '-g')
        if kwargs['group'] in parsed:
            current = parsed['Groups'][kwargs['group']]
        else:
            current = empty
        ret = 'Group: {0}'.format(kwargs['group'])

    if not current:
        raise CommandExecutionError('A valid user or group was not found')

    for limit in ('block-soft-limit', 'block-hard-limit',
                  'file-soft-limit', 'file-hard-limit'):
        if limit in kwargs:
            current[limit] = kwargs[limit]

    cmd += '{0} {1} {2} {3} {4}'.format(current['block-soft-limit'],
                                        current['block-hard-limit'],
                                        current['file-soft-limit'],
                                        current['file-hard-limit'],
                                        device)

    result = __salt__['cmd.run_all'](cmd, python_shell=False)
    if result['retcode'] != 0:
        raise CommandExecutionError(
            'Unable to set desired quota. Error follows: \n{0}'
            .format(result['stderr'])
        )
    return {ret: current}
560567
def set_scanner_alert_threshold(self, scanner_ids, alert_threshold):
        """"""
        for scanner_id in scanner_ids:
            self.logger.debug('Setting alert threshold for scanner {0} to {1}'.format(scanner_id, alert_threshold))
            result = self.zap.ascan.set_scanner_alert_threshold(scanner_id, alert_threshold)
            if result != 'OK':
                raise ZAPError('Error setting alert threshold for scanner with ID {0}: {1}'.format(scanner_id, result))
129516
def set_timelimit(self, timelimit):
        """"""
        super().set_timelimit(timelimit)
        self.qparams["wall_clock_limit"] = qu.time2loadlever(timelimit)