From 661570dfadc10c85f8bcdac878720ba38b768f59 Mon Sep 17 00:00:00 2001 From: Daniel Shokouhi Date: Wed, 18 Mar 2020 13:19:40 -0700 Subject: [PATCH] Small tweaks (#32946) --- homeassistant/components/obihai/manifest.json | 2 +- homeassistant/components/obihai/sensor.py | 10 ++++++---- requirements_all.txt | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/obihai/manifest.json b/homeassistant/components/obihai/manifest.json index 3a979922eba..de85a85842a 100644 --- a/homeassistant/components/obihai/manifest.json +++ b/homeassistant/components/obihai/manifest.json @@ -2,7 +2,7 @@ "domain": "obihai", "name": "Obihai", "documentation": "https://www.home-assistant.io/integrations/obihai", - "requirements": ["pyobihai==1.2.0"], + "requirements": ["pyobihai==1.2.1"], "dependencies": [], "codeowners": ["@dshokouhi"] } diff --git a/homeassistant/components/obihai/sensor.py b/homeassistant/components/obihai/sensor.py index 13d09de0542..a81b381f1ed 100644 --- a/homeassistant/components/obihai/sensor.py +++ b/homeassistant/components/obihai/sensor.py @@ -59,8 +59,9 @@ def setup_platform(hass, config, add_entities, discovery_info=None): for key in services: sensors.append(ObihaiServiceSensors(pyobihai, serial, key)) - for key in line_services: - sensors.append(ObihaiServiceSensors(pyobihai, serial, key)) + if line_services is not None: + for key in line_services: + sensors.append(ObihaiServiceSensors(pyobihai, serial, key)) for key in call_direction: sensors.append(ObihaiServiceSensors(pyobihai, serial, key)) @@ -136,8 +137,9 @@ class ObihaiServiceSensors(Entity): services = self._pyobihai.get_line_state() - if self._service_name in services: - self._state = services.get(self._service_name) + if services is not None: + if self._service_name in services: + self._state = services.get(self._service_name) call_direction = self._pyobihai.get_call_direction() diff --git a/requirements_all.txt b/requirements_all.txt index 235558575e1..b6e90b841dd 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1432,7 +1432,7 @@ pynx584==0.4 pynzbgetapi==0.2.0 # homeassistant.components.obihai -pyobihai==1.2.0 +pyobihai==1.2.1 # homeassistant.components.ombi pyombi==0.1.10