Only add SAJ sensors that are enabled and available (#34978)
* Bump pysaj to 0.0.16 * Only add SAJ sensors that are enabled/available
This commit is contained in:
1 parent
cf30895460
commit
da0ff8d8c4
3 files changed
+6
-5
No files matched your search
@@ -2,6 +2,6 @@
|
||||
"domain": "saj",
|
||||
"name": "SAJ Solar Inverter",
|
||||
"documentation": "https://www.home-assistant.io/integrations/saj",
|
||||
"requirements": ["pysaj==0.0.14"],
|
||||
"requirements": ["pysaj==0.0.16"],
|
||||
"codeowners": ["@fredericvl"]
|
||||
}
|
||||
@@ -91,9 +91,10 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||
raise PlatformNotReady
|
||||
|
||||
for sensor in sensor_def:
|
||||
hass_sensors.append(
|
||||
SAJsensor(saj.serialnumber, sensor, inverter_name=config.get(CONF_NAME))
|
||||
)
|
||||
if sensor.enabled:
|
||||
hass_sensors.append(
|
||||
SAJsensor(saj.serialnumber, sensor, inverter_name=config.get(CONF_NAME))
|
||||
)
|
||||
|
||||
async_add_entities(hass_sensors)
|
||||
|
||||
|
||||
Reference in new issue
Block a user