Skip to content

Commit

Permalink
Bug Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
c503ghosh committed Feb 28, 2024
1 parent 26b7ae6 commit 9f795e9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
10 changes: 5 additions & 5 deletions custom_components/dirigera_platform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ async def async_setup_entry(hass: core.HomeAssistant, entry: config_entries.Conf
hass.data[DOMAIN][entry.entry_id] = hass_data

# Setup the entities
#hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, "light"))
#hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, "switch"))
#hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, "binary_sensor"))
#hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, "sensor"))
#hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, "cover"))
hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, "light"))
hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, "switch"))
hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, "binary_sensor"))
hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, "sensor"))
hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, "cover"))
hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, "fan"))

logger.debug("Complete async_setup_entry...")
Expand Down
5 changes: 2 additions & 3 deletions custom_components/dirigera_platform/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@ async def async_setup_entry(
if config[CONF_IP_ADDRESS] == "mock":
logger.warning("Setting up mock motion sensors")
mock_motion_sensor1 = ikea_motion_sensor_mock()
mock_motion_sensor2 = ikea_motion_sensor_mock()
motion_sensors = [mock_motion_sensor1,mock_motion_sensor2]
motion_sensors = [mock_motion_sensor1]

logger.warning("Setting up mock open/close sensors")
mock_open_close_sensor1 = ikea_open_close_mock()
mock_open_close_sensor2 = ikea_open_close_mock()
open_close_sensors = [mock_open_close_sensor1,mock_open_close_sensor2]
open_close_sensors = [mock_open_close_sensor1]

else:
hub_motion_sensors = await hass.async_add_executor_job(hub.get_motion_sensors)
Expand Down
3 changes: 1 addition & 2 deletions custom_components/dirigera_platform/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ async def async_setup_entry(hass: core.HomeAssistant, config_entry: config_entri
if config[CONF_IP_ADDRESS] == "mock":
logger.warning("Setting up mock blinds...")
mock_blind1 = ikea_blinds_mock(hub,"mock_blind1")
mock_blind2 = ikea_blinds_mock(hub,"mock_blind2")
blinds = [mock_blind1,mock_blind2]
blinds = [mock_blind1]
else:
hub_blinds = await hass.async_add_executor_job(hub.get_blinds)
blinds = [ikea_blinds(hub, blind) for blind in hub_blinds]
Expand Down
3 changes: 1 addition & 2 deletions custom_components/dirigera_platform/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ async def async_setup_entry(
if config[CONF_IP_ADDRESS] == "mock":
logger.warning("Setting up mock bulbs")
mock_bulb1 = ikea_bulb_mock()
mock_bulb2 = ikea_bulb_mock()
lights = [mock_bulb1,mock_bulb2]
lights = [mock_bulb1]
else:
hub_lights = await hass.async_add_executor_job(hub.get_lights)
lights = [ikea_bulb(hub, light) for light in hub_lights]
Expand Down
3 changes: 1 addition & 2 deletions custom_components/dirigera_platform/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ async def async_setup_entry(hass: core.HomeAssistant, config_entry: config_entri
if config[CONF_IP_ADDRESS] == "mock":
logger.warning("Setting up mock outlets...")
mock_outlet1 = ikea_outlet_mock(hub,"mock_outlet1")
mock_outlet2 = ikea_outlet_mock(hub,"mock_outlet2")
outlets = [mock_outlet1,mock_outlet2]
outlets = [mock_outlet1]
else:
hub_outlets = await hass.async_add_executor_job(hub.get_outlets)
outlets = [ikea_outlet(hub, outlet) for outlet in hub_outlets]
Expand Down

0 comments on commit 9f795e9

Please sign in to comment.