Philips Hue: Add bridge update prompt (#21119)

* Add a prompt if bridge update is available.

* Change logger warning for light update

The self.light.swupdatestate only checks for updates of that specific light, it does not check for updates of the bridge.
Theirfore the warning message schould be updated.

* add space

* fix tests

* rename to swupdate2_bridge_state

* update aiohue to v1.9.1

* update aiohue to v1.9.1

* update aiohue to v1.9.1
This commit is contained in:
starkillerOG 2019-02-19 06:31:42 +01:00 committed by Paulus Schoutsen
parent bc46e48d23
commit 921efbdfef
5 changed files with 16 additions and 12 deletions

View File

@ -14,7 +14,7 @@ from .bridge import HueBridge
# Loading the config flow file will register the flow # Loading the config flow file will register the flow
from .config_flow import configured_hosts from .config_flow import configured_hosts
REQUIREMENTS = ['aiohue==1.9.0'] REQUIREMENTS = ['aiohue==1.9.1']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -121,11 +121,17 @@ async def async_setup_entry(hass, entry):
}, },
manufacturer='Signify', manufacturer='Signify',
name=config.name, name=config.name,
# Not yet exposed as properties in aiohue model=config.modelid,
model=config.raw['modelid'], sw_version=config.swversion,
sw_version=config.raw['swversion'],
) )
if config.swupdate2_bridge_state == "readytoinstall":
err = (
"Please check for software updates of the bridge "
"in the Philips Hue App."
)
_LOGGER.warning(err)
return True return True

View File

@ -227,8 +227,8 @@ class HueLight(Light):
_LOGGER.debug("Color gamut of %s: %s", self.name, str(self.gamut)) _LOGGER.debug("Color gamut of %s: %s", self.name, str(self.gamut))
if self.light.swupdatestate == "readytoinstall": if self.light.swupdatestate == "readytoinstall":
err = ( err = (
"Please check for software updates of the bridge " "Please check for software updates of the %s "
"and/or the bulb: %s, in the Philips Hue App." "bulb in the Philips Hue App."
) )
_LOGGER.warning(err, self.name) _LOGGER.warning(err, self.name)
if self.gamut: if self.gamut:

View File

@ -118,7 +118,7 @@ aioharmony==0.1.5
aiohttp_cors==0.7.0 aiohttp_cors==0.7.0
# homeassistant.components.hue # homeassistant.components.hue
aiohue==1.9.0 aiohue==1.9.1
# homeassistant.components.sensor.iliad_italy # homeassistant.components.sensor.iliad_italy
aioiliad==0.1.1 aioiliad==0.1.1

View File

@ -41,7 +41,7 @@ aioautomatic==0.6.5
aiohttp_cors==0.7.0 aiohttp_cors==0.7.0
# homeassistant.components.hue # homeassistant.components.hue
aiohue==1.9.0 aiohue==1.9.1
# homeassistant.components.unifi # homeassistant.components.unifi
aiounifi==4 aiounifi==4

View File

@ -97,10 +97,8 @@ async def test_config_passed_to_config_entry(hass):
mock_bridge.return_value.api.config = Mock( mock_bridge.return_value.api.config = Mock(
mac='mock-mac', mac='mock-mac',
bridgeid='mock-bridgeid', bridgeid='mock-bridgeid',
raw={ modelid='mock-modelid',
'modelid': 'mock-modelid', swversion='mock-swversion'
'swversion': 'mock-swversion',
}
) )
# Can't set name via kwargs # Can't set name via kwargs
mock_bridge.return_value.api.config.name = 'mock-name' mock_bridge.return_value.api.config.name = 'mock-name'