Skip to content

Commit

Permalink
Backwards compatible with config
Browse files Browse the repository at this point in the history
  • Loading branch information
jaster116 committed Apr 28, 2023
1 parent 1b379b8 commit 75f331f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 23 deletions.
4 changes: 1 addition & 3 deletions custom_components/yandex_station/humidifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
devices = [
YandexHumidifier(quasar, device)
for device in quasar.devices
if next((inc for inc in include if inc["name"] == device["name"]), None)
is not None
and device["type"] in DEVICES
if device["name"] in include and device["type"] in DEVICES
]

platform = entity_platform.async_get_current_platform()
Expand Down
4 changes: 1 addition & 3 deletions custom_components/yandex_station/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
devices = [
YandexLight(quasar, device)
for device in quasar.devices
if next((inc for inc in include if inc["name"] == device["name"]), None)
is not None
and device["type"] in DEVICES
if device["name"] in include and device["type"] in DEVICES
]
async_add_entities(devices, True)

Expand Down
4 changes: 1 addition & 3 deletions custom_components/yandex_station/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
devices = [
YandexOther(quasar, device)
for device in quasar.devices
if next((inc for inc in include if inc["name"] == device["name"]), None)
is not None
and device["type"] in DEVICES
if device["name"] in include and device["type"] in DEVICES
]
async_add_entities(devices, True)

Expand Down
6 changes: 1 addition & 5 deletions custom_components/yandex_station/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ async def async_setup_entry(hass, entry, async_add_entities):

devices = []
for device in quasar.devices:
if (
next((inc for inc in include if inc["name"] == device["name"]), None)
is not None
and device["type"] in DEVICES
):
if device["name"] in include and device["type"] in DEVICES:
data = await quasar.get_device(device["id"])
for prop in data["properties"]:
for description in SENSOR_TYPES:
Expand Down
4 changes: 1 addition & 3 deletions custom_components/yandex_station/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
devices = [
YandexSwitch(quasar, device)
for device in quasar.devices
if next((inc for inc in include if inc["name"] == device["name"]), None)
is not None
and device["type"] in DEVICES
if device["name"] in include and device["type"] in DEVICES
]
async_add_entities(devices, True)

Expand Down
4 changes: 1 addition & 3 deletions custom_components/yandex_station/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
devices = [
YandexVacuum(quasar, device)
for device in quasar.devices
if next((inc for inc in include if inc["name"] == device["name"]), None)
is not None
and device["type"] in DEVICES
if device["name"] in include and device["type"] in DEVICES
]
async_add_entities(devices)

Expand Down
4 changes: 1 addition & 3 deletions custom_components/yandex_station/water_heater.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
devices = [
YandexKettle(quasar, device)
for device in quasar.devices
if next((inc for inc in include if inc["name"] == device["name"]), None)
is not None
and device["type"] in DEVICES
if device["name"] in include and device["type"] in DEVICES
]
async_add_entities(devices, True)

Expand Down

0 comments on commit 75f331f

Please sign in to comment.