mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-10-31 04:01:59 +01:00
refactor(sensors): remove legacy Station G3 fallback
This commit is contained in:
1 parent
0d28072063
commit
50921e1400
2 files changed
+4
-26
No files matched your search
@@ -210,25 +210,6 @@ class OpenHopModemSensor(SensorBase):
|
||||
if out.get(key) is None and system.get(key) is not None:
|
||||
out[key] = system[key]
|
||||
|
||||
station_g3_fallbacks = {
|
||||
"bus_voltage_v": ("bus_voltage_v", "station_g3_input_voltage_v"),
|
||||
"current_ma": ("current_ma", "station_g3_current_ma"),
|
||||
"power_mw": ("power_mw",),
|
||||
}
|
||||
for output_key, system_keys in station_g3_fallbacks.items():
|
||||
if out.get(output_key) is not None:
|
||||
continue
|
||||
for system_key in system_keys:
|
||||
value = self._float(system.get(system_key))
|
||||
if value is not None:
|
||||
out[output_key] = value
|
||||
break
|
||||
|
||||
if out.get("power_mw") is None:
|
||||
power_w = self._float(system.get("station_g3_power_w"))
|
||||
if power_w is not None:
|
||||
out["power_mw"] = power_w * 1000.0
|
||||
|
||||
if "battery_percent" not in out:
|
||||
battery_voltage_v = self._float(out.get("battery_voltage_v"))
|
||||
if battery_voltage_v is None:
|
||||
|
||||
Reference in new issue
Block a user