Add myStrom LED Strip support extending rgblamp bulb_type (#57322)

pull/58570/head
Andreas Sansano 2021-10-27 10:11:26 +02:00 committed by GitHub
parent 4653d0b079
commit d827b2ff56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -49,8 +49,10 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
bulb = MyStromBulb(host, mac)
try:
await bulb.get_state()
if bulb.bulb_type != "rgblamp":
_LOGGER.error("Device %s (%s) is not a myStrom bulb", host, mac)
if bulb.bulb_type not in ["rgblamp", "strip"]:
_LOGGER.error(
"Device %s (%s) is not a myStrom bulb nor myStrom LED Strip", host, mac
)
return
except MyStromConnectionError as err:
_LOGGER.warning("No route to myStrom bulb: %s", host)