From 0987219b2828417c78e12763656626401eb934bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= Date: Sat, 19 Jan 2019 19:23:22 +0100 Subject: [PATCH] Tibber Pulse for homes without subscriptions (#20246) --- homeassistant/components/sensor/tibber.py | 5 +++-- homeassistant/components/tibber/__init__.py | 2 +- requirements_all.txt | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/sensor/tibber.py b/homeassistant/components/sensor/tibber.py index 0ba470ca778..bc3951f0dea 100644 --- a/homeassistant/components/sensor/tibber.py +++ b/homeassistant/components/sensor/tibber.py @@ -45,11 +45,12 @@ async def async_setup_platform(hass, config, async_add_entities, except aiohttp.ClientError as err: _LOGGER.error("Error connecting to Tibber home: %s ", err) raise PlatformNotReady() - dev.append(TibberSensorElPrice(home)) + if home.has_active_subscription: + dev.append(TibberSensorElPrice(home)) if home.has_real_time_consumption: dev.append(TibberSensorRT(home)) - async_add_entities(dev, False) + async_add_entities(dev, True) class TibberSensorElPrice(Entity): diff --git a/homeassistant/components/tibber/__init__.py b/homeassistant/components/tibber/__init__.py index 8967021a0cf..8492596332a 100644 --- a/homeassistant/components/tibber/__init__.py +++ b/homeassistant/components/tibber/__init__.py @@ -16,7 +16,7 @@ from homeassistant.const import (EVENT_HOMEASSISTANT_STOP, CONF_ACCESS_TOKEN, from homeassistant.helpers import discovery from homeassistant.helpers.aiohttp_client import async_get_clientsession -REQUIREMENTS = ['pyTibber==0.9.0'] +REQUIREMENTS = ['pyTibber==0.9.1'] DOMAIN = 'tibber' diff --git a/requirements_all.txt b/requirements_all.txt index a1e5c2512bf..ae384c756cf 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -879,7 +879,7 @@ pyRFXtrx==0.23 pySwitchmate==0.4.4 # homeassistant.components.tibber -pyTibber==0.9.0 +pyTibber==0.9.1 # homeassistant.components.switch.dlink pyW215==0.6.0