From da0ff8d8c4e0d71f5cee977a18049e285f722f71 Mon Sep 17 00:00:00 2001 From: fredericvl <34839323+fredericvl@users.noreply.github.com> Date: Sun, 10 May 2020 04:23:57 +0200 Subject: [PATCH] Only add SAJ sensors that are enabled and available (#34978) * Bump pysaj to 0.0.16 * Only add SAJ sensors that are enabled/available --- homeassistant/components/saj/manifest.json | 2 +- homeassistant/components/saj/sensor.py | 7 ++++--- requirements_all.txt | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/saj/manifest.json b/homeassistant/components/saj/manifest.json index c4002f252e8..fdd999ac684 100644 --- a/homeassistant/components/saj/manifest.json +++ b/homeassistant/components/saj/manifest.json @@ -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"] } diff --git a/homeassistant/components/saj/sensor.py b/homeassistant/components/saj/sensor.py index fb0df36d4cb..1e7b3dd5061 100644 --- a/homeassistant/components/saj/sensor.py +++ b/homeassistant/components/saj/sensor.py @@ -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) diff --git a/requirements_all.txt b/requirements_all.txt index ac9de32470f..351aab85ce8 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1557,7 +1557,7 @@ pyrepetier==3.0.5 pysabnzbd==1.1.0 # homeassistant.components.saj -pysaj==0.0.14 +pysaj==0.0.16 # homeassistant.components.sony_projector pysdcp==1