diff --git a/repeater/sensors/bme280.py b/repeater/sensors/bme280.py index 8ae6f4e..5db1eb6 100644 --- a/repeater/sensors/bme280.py +++ b/repeater/sensors/bme280.py @@ -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): diff --git a/repeater/sensors/ens210.py b/repeater/sensors/ens210.py index 0888f36..ed01d15 100644 --- a/repeater/sensors/ens210.py +++ b/repeater/sensors/ens210.py @@ -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): diff --git a/repeater/sensors/ina219.py b/repeater/sensors/ina219.py index f049125..ed26c32 100644 --- a/repeater/sensors/ina219.py +++ b/repeater/sensors/ina219.py @@ -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): diff --git a/repeater/sensors/lafvin_ups_3s.py b/repeater/sensors/lafvin_ups_3s.py index 8755d1e..29abd8b 100644 --- a/repeater/sensors/lafvin_ups_3s.py +++ b/repeater/sensors/lafvin_ups_3s.py @@ -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): diff --git a/repeater/sensors/openhop_modem.py b/repeater/sensors/openhop_modem.py index 09c36c4..22e9c2d 100644 --- a/repeater/sensors/openhop_modem.py +++ b/repeater/sensors/openhop_modem.py @@ -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): diff --git a/repeater/sensors/shtc3.py b/repeater/sensors/shtc3.py index 07063a9..d76371f 100644 --- a/repeater/sensors/shtc3.py +++ b/repeater/sensors/shtc3.py @@ -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): diff --git a/repeater/sensors/waveshare_ups_d.py b/repeater/sensors/waveshare_ups_d.py index 47fa506..8a07a37 100644 --- a/repeater/sensors/waveshare_ups_d.py +++ b/repeater/sensors/waveshare_ups_d.py @@ -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): diff --git a/repeater/sensors/waveshare_ups_e.py b/repeater/sensors/waveshare_ups_e.py index 7c753f7..bf47c35 100644 --- a/repeater/sensors/waveshare_ups_e.py +++ b/repeater/sensors/waveshare_ups_e.py @@ -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):