mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-10-31 04:01:59 +01:00
style(sensors): apply pinned Ruff formatting
This commit is contained in:
1 parent
9cd6d7bf14
commit
b51aed023d
8 files changed
+203
-29
No files matched your search
@@ -48,9 +48,27 @@ class BME280Sensor(SensorBase):
|
||||
sensor_type = "bme280"
|
||||
|
||||
_settings_schema = [
|
||||
{"key": "i2c_address", "type": "string", "label": "I2C Address", "default": "0x76", "help": "Hex I2C address (e.g. 0x76, 0x77)"},
|
||||
{"key": "bus_number", "type": "integer", "label": "I2C Bus Number", "default": 0, "help": "Linux I2C bus number"},
|
||||
{"key": "read_timeout_seconds", "type": "number", "label": "Read Timeout (s)", "default": 1.0, "help": "Max time to wait for measurement"},
|
||||
{
|
||||
"key": "i2c_address",
|
||||
"type": "string",
|
||||
"label": "I2C Address",
|
||||
"default": "0x76",
|
||||
"help": "Hex I2C address (e.g. 0x76, 0x77)",
|
||||
},
|
||||
{
|
||||
"key": "bus_number",
|
||||
"type": "integer",
|
||||
"label": "I2C Bus Number",
|
||||
"default": 0,
|
||||
"help": "Linux I2C bus number",
|
||||
},
|
||||
{
|
||||
"key": "read_timeout_seconds",
|
||||
"type": "number",
|
||||
"label": "Read Timeout (s)",
|
||||
"default": 1.0,
|
||||
"help": "Max time to wait for measurement",
|
||||
},
|
||||
]
|
||||
|
||||
def __init__(self, name: str, config: Optional[Dict[str, Any]] = None, log=None):
|
||||
|
||||
@@ -34,9 +34,27 @@ class ENS210Sensor(SensorBase):
|
||||
sensor_type = "ens210"
|
||||
|
||||
_settings_schema = [
|
||||
{"key": "i2c_address", "type": "string", "label": "I2C Address", "default": "0x43", "help": "Hex I2C address (e.g. 0x43)"},
|
||||
{"key": "bus_number", "type": "integer", "label": "I2C Bus Number", "default": 0, "help": "Linux I2C bus number"},
|
||||
{"key": "read_timeout_seconds", "type": "number", "label": "Read Timeout (s)", "default": 1.0, "help": "Max time to wait for measurement"},
|
||||
{
|
||||
"key": "i2c_address",
|
||||
"type": "string",
|
||||
"label": "I2C Address",
|
||||
"default": "0x43",
|
||||
"help": "Hex I2C address (e.g. 0x43)",
|
||||
},
|
||||
{
|
||||
"key": "bus_number",
|
||||
"type": "integer",
|
||||
"label": "I2C Bus Number",
|
||||
"default": 0,
|
||||
"help": "Linux I2C bus number",
|
||||
},
|
||||
{
|
||||
"key": "read_timeout_seconds",
|
||||
"type": "number",
|
||||
"label": "Read Timeout (s)",
|
||||
"default": 1.0,
|
||||
"help": "Max time to wait for measurement",
|
||||
},
|
||||
]
|
||||
|
||||
def __init__(self, name: str, config: Optional[Dict[str, Any]] = None, log=None):
|
||||
|
||||
@@ -39,10 +39,34 @@ class INA219Sensor(SensorBase):
|
||||
sensor_type = "ina219"
|
||||
|
||||
_settings_schema = [
|
||||
{"key": "i2c_address", "type": "string", "label": "I2C Address", "default": "0x40", "help": "Hex I2C address (e.g. 0x40, 0x41, 0x44, 0x45)"},
|
||||
{"key": "bus_number", "type": "integer", "label": "I2C Bus Number", "default": 0, "help": "Linux I2C bus number"},
|
||||
{"key": "max_expected_amps", "type": "number", "label": "Max Expected Amps", "default": 2.0, "help": "Maximum expected current for calibration"},
|
||||
{"key": "shunt_ohms", "type": "number", "label": "Shunt Resistor (Ω)", "default": 0.1, "help": "Shunt resistor value in ohms"},
|
||||
{
|
||||
"key": "i2c_address",
|
||||
"type": "string",
|
||||
"label": "I2C Address",
|
||||
"default": "0x40",
|
||||
"help": "Hex I2C address (e.g. 0x40, 0x41, 0x44, 0x45)",
|
||||
},
|
||||
{
|
||||
"key": "bus_number",
|
||||
"type": "integer",
|
||||
"label": "I2C Bus Number",
|
||||
"default": 0,
|
||||
"help": "Linux I2C bus number",
|
||||
},
|
||||
{
|
||||
"key": "max_expected_amps",
|
||||
"type": "number",
|
||||
"label": "Max Expected Amps",
|
||||
"default": 2.0,
|
||||
"help": "Maximum expected current for calibration",
|
||||
},
|
||||
{
|
||||
"key": "shunt_ohms",
|
||||
"type": "number",
|
||||
"label": "Shunt Resistor (Ω)",
|
||||
"default": 0.1,
|
||||
"help": "Shunt resistor value in ohms",
|
||||
},
|
||||
]
|
||||
|
||||
def __init__(self, name: str, config: Optional[Dict[str, Any]] = None, log=None):
|
||||
|
||||
@@ -68,10 +68,34 @@ class LafvinUps3sSensor(SensorBase):
|
||||
sensor_type = "lafvin_ups_3s"
|
||||
|
||||
_settings_schema = [
|
||||
{"key": "i2c_address", "type": "string", "label": "I2C Address", "default": "0x41", "help": "Hex I2C address (e.g. 0x41)"},
|
||||
{"key": "bus_number", "type": "integer", "label": "I2C Bus Number", "default": 0, "help": "Linux I2C bus number"},
|
||||
{"key": "shunt_ohms", "type": "number", "label": "Shunt Resistor (Ω)", "default": 0.1, "help": "Shunt resistor value in ohms"},
|
||||
{"key": "max_amps", "type": "number", "label": "Max Amps", "default": 5.0, "help": "Maximum expected current in amps"},
|
||||
{
|
||||
"key": "i2c_address",
|
||||
"type": "string",
|
||||
"label": "I2C Address",
|
||||
"default": "0x41",
|
||||
"help": "Hex I2C address (e.g. 0x41)",
|
||||
},
|
||||
{
|
||||
"key": "bus_number",
|
||||
"type": "integer",
|
||||
"label": "I2C Bus Number",
|
||||
"default": 0,
|
||||
"help": "Linux I2C bus number",
|
||||
},
|
||||
{
|
||||
"key": "shunt_ohms",
|
||||
"type": "number",
|
||||
"label": "Shunt Resistor (Ω)",
|
||||
"default": 0.1,
|
||||
"help": "Shunt resistor value in ohms",
|
||||
},
|
||||
{
|
||||
"key": "max_amps",
|
||||
"type": "number",
|
||||
"label": "Max Amps",
|
||||
"default": 5.0,
|
||||
"help": "Maximum expected current in amps",
|
||||
},
|
||||
]
|
||||
|
||||
def __init__(self, name: str, config: Optional[Dict[str, Any]] = None, log=None):
|
||||
|
||||
@@ -35,14 +35,62 @@ class OpenHopModemSensor(SensorBase):
|
||||
sensor_type = "openhop_modem"
|
||||
|
||||
_settings_schema = [
|
||||
{"key": "host", "type": "string", "label": "Host", "default": "", "help": "Modem hostname or IP address"},
|
||||
{"key": "port", "type": "integer", "label": "Port", "default": 80, "help": "Modem HTTP API port (not the radio TCP port)"},
|
||||
{"key": "scheme", "type": "string", "label": "Scheme", "default": "http", "help": "HTTP or HTTPS"},
|
||||
{"key": "endpoint", "type": "string", "label": "Endpoint", "default": "/api/stats", "help": "Stats API path"},
|
||||
{"key": "username", "type": "string", "label": "Username", "default": "admin", "help": "Basic auth username"},
|
||||
{"key": "password", "type": "string", "label": "Password", "default": "", "help": "Basic auth password (not stored in API responses)"},
|
||||
{"key": "poll_interval_seconds", "type": "number", "label": "Poll Interval (s)", "default": 60.0, "help": "How often to poll"},
|
||||
{"key": "timeout_seconds", "type": "number", "label": "Timeout (s)", "default": 2.0, "help": "Request timeout"},
|
||||
{
|
||||
"key": "host",
|
||||
"type": "string",
|
||||
"label": "Host",
|
||||
"default": "",
|
||||
"help": "Modem hostname or IP address",
|
||||
},
|
||||
{
|
||||
"key": "port",
|
||||
"type": "integer",
|
||||
"label": "Port",
|
||||
"default": 80,
|
||||
"help": "Modem HTTP API port (not the radio TCP port)",
|
||||
},
|
||||
{
|
||||
"key": "scheme",
|
||||
"type": "string",
|
||||
"label": "Scheme",
|
||||
"default": "http",
|
||||
"help": "HTTP or HTTPS",
|
||||
},
|
||||
{
|
||||
"key": "endpoint",
|
||||
"type": "string",
|
||||
"label": "Endpoint",
|
||||
"default": "/api/stats",
|
||||
"help": "Stats API path",
|
||||
},
|
||||
{
|
||||
"key": "username",
|
||||
"type": "string",
|
||||
"label": "Username",
|
||||
"default": "admin",
|
||||
"help": "Basic auth username",
|
||||
},
|
||||
{
|
||||
"key": "password",
|
||||
"type": "string",
|
||||
"label": "Password",
|
||||
"default": "",
|
||||
"help": "Basic auth password (not stored in API responses)",
|
||||
},
|
||||
{
|
||||
"key": "poll_interval_seconds",
|
||||
"type": "number",
|
||||
"label": "Poll Interval (s)",
|
||||
"default": 60.0,
|
||||
"help": "How often to poll",
|
||||
},
|
||||
{
|
||||
"key": "timeout_seconds",
|
||||
"type": "number",
|
||||
"label": "Timeout (s)",
|
||||
"default": 2.0,
|
||||
"help": "Request timeout",
|
||||
},
|
||||
]
|
||||
|
||||
def __init__(self, name: str, config: Optional[Dict[str, Any]] = None, log=None):
|
||||
|
||||
@@ -35,8 +35,20 @@ class SHTC3Sensor(SensorBase):
|
||||
sensor_type = "shtc3"
|
||||
|
||||
_settings_schema = [
|
||||
{"key": "i2c_address", "type": "string", "label": "I2C Address", "default": "0x70", "help": "Hex I2C address (e.g. 0x70)"},
|
||||
{"key": "bus_number", "type": "integer", "label": "I2C Bus Number", "default": 0, "help": "Linux I2C bus number"},
|
||||
{
|
||||
"key": "i2c_address",
|
||||
"type": "string",
|
||||
"label": "I2C Address",
|
||||
"default": "0x70",
|
||||
"help": "Hex I2C address (e.g. 0x70)",
|
||||
},
|
||||
{
|
||||
"key": "bus_number",
|
||||
"type": "integer",
|
||||
"label": "I2C Bus Number",
|
||||
"default": 0,
|
||||
"help": "Linux I2C bus number",
|
||||
},
|
||||
]
|
||||
|
||||
def __init__(self, name: str, config: Optional[Dict[str, Any]] = None, log=None):
|
||||
|
||||
@@ -64,8 +64,20 @@ class WaveshareUpsDSensor(SensorBase):
|
||||
sensor_type = "waveshare_ups_d"
|
||||
|
||||
_settings_schema = [
|
||||
{"key": "i2c_address", "type": "string", "label": "I2C Address", "default": "0x43", "help": "Hex I2C address (e.g. 0x43)"},
|
||||
{"key": "bus_number", "type": "integer", "label": "I2C Bus Number", "default": 0, "help": "Linux I2C bus number"},
|
||||
{
|
||||
"key": "i2c_address",
|
||||
"type": "string",
|
||||
"label": "I2C Address",
|
||||
"default": "0x43",
|
||||
"help": "Hex I2C address (e.g. 0x43)",
|
||||
},
|
||||
{
|
||||
"key": "bus_number",
|
||||
"type": "integer",
|
||||
"label": "I2C Bus Number",
|
||||
"default": 0,
|
||||
"help": "Linux I2C bus number",
|
||||
},
|
||||
]
|
||||
|
||||
def __init__(self, name: str, config: Optional[Dict[str, Any]] = None, log=None):
|
||||
|
||||
@@ -46,9 +46,27 @@ class WaveshareUpsESensor(SensorBase):
|
||||
sensor_type = "waveshare_ups_e"
|
||||
|
||||
_settings_schema = [
|
||||
{"key": "i2c_address", "type": "string", "label": "I2C Address", "default": "0x2D", "help": "Hex I2C address (e.g. 0x2D)"},
|
||||
{"key": "bus_number", "type": "integer", "label": "I2C Bus Number", "default": 0, "help": "Linux I2C bus number"},
|
||||
{"key": "low_cell_mv", "type": "integer", "label": "Low Cell Threshold (mV)", "default": 3150, "help": "Per-cell voltage warning threshold in mV"},
|
||||
{
|
||||
"key": "i2c_address",
|
||||
"type": "string",
|
||||
"label": "I2C Address",
|
||||
"default": "0x2D",
|
||||
"help": "Hex I2C address (e.g. 0x2D)",
|
||||
},
|
||||
{
|
||||
"key": "bus_number",
|
||||
"type": "integer",
|
||||
"label": "I2C Bus Number",
|
||||
"default": 0,
|
||||
"help": "Linux I2C bus number",
|
||||
},
|
||||
{
|
||||
"key": "low_cell_mv",
|
||||
"type": "integer",
|
||||
"label": "Low Cell Threshold (mV)",
|
||||
"default": 3150,
|
||||
"help": "Per-cell voltage warning threshold in mV",
|
||||
},
|
||||
]
|
||||
|
||||
def __init__(self, name: str, config: Optional[Dict[str, Any]] = None, log=None):
|
||||
|
||||
Reference in new issue
Block a user