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:
parent
bc46e48d23
commit
921efbdfef
5 changed files with 16 additions and 12 deletions
|
@ -14,7 +14,7 @@ from .bridge import HueBridge
|
|||
# Loading the config flow file will register the flow
|
||||
from .config_flow import configured_hosts
|
||||
|
||||
REQUIREMENTS = ['aiohue==1.9.0']
|
||||
REQUIREMENTS = ['aiohue==1.9.1']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -121,11 +121,17 @@ async def async_setup_entry(hass, entry):
|
|||
},
|
||||
manufacturer='Signify',
|
||||
name=config.name,
|
||||
# Not yet exposed as properties in aiohue
|
||||
model=config.raw['modelid'],
|
||||
sw_version=config.raw['swversion'],
|
||||
model=config.modelid,
|
||||
sw_version=config.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
|
||||
|
||||
|
||||
|
|
|
@ -227,8 +227,8 @@ class HueLight(Light):
|
|||
_LOGGER.debug("Color gamut of %s: %s", self.name, str(self.gamut))
|
||||
if self.light.swupdatestate == "readytoinstall":
|
||||
err = (
|
||||
"Please check for software updates of the bridge "
|
||||
"and/or the bulb: %s, in the Philips Hue App."
|
||||
"Please check for software updates of the %s "
|
||||
"bulb in the Philips Hue App."
|
||||
)
|
||||
_LOGGER.warning(err, self.name)
|
||||
if self.gamut:
|
||||
|
|
|
@ -118,7 +118,7 @@ aioharmony==0.1.5
|
|||
aiohttp_cors==0.7.0
|
||||
|
||||
# homeassistant.components.hue
|
||||
aiohue==1.9.0
|
||||
aiohue==1.9.1
|
||||
|
||||
# homeassistant.components.sensor.iliad_italy
|
||||
aioiliad==0.1.1
|
||||
|
|
|
@ -41,7 +41,7 @@ aioautomatic==0.6.5
|
|||
aiohttp_cors==0.7.0
|
||||
|
||||
# homeassistant.components.hue
|
||||
aiohue==1.9.0
|
||||
aiohue==1.9.1
|
||||
|
||||
# homeassistant.components.unifi
|
||||
aiounifi==4
|
||||
|
|
|
@ -97,10 +97,8 @@ async def test_config_passed_to_config_entry(hass):
|
|||
mock_bridge.return_value.api.config = Mock(
|
||||
mac='mock-mac',
|
||||
bridgeid='mock-bridgeid',
|
||||
raw={
|
||||
'modelid': 'mock-modelid',
|
||||
'swversion': 'mock-swversion',
|
||||
}
|
||||
modelid='mock-modelid',
|
||||
swversion='mock-swversion'
|
||||
)
|
||||
# Can't set name via kwargs
|
||||
mock_bridge.return_value.api.config.name = 'mock-name'
|
||||
|
|
Loading…
Add table
Reference in a new issue