Skip to content

Commit

Permalink
🐛 Do not update before add
Browse files Browse the repository at this point in the history
it lead to long time to init
  • Loading branch information
MateoGreil committed Jan 3, 2025
1 parent 131f822 commit a989da7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/comwatt/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
# TODO: Remove old existing devices?

if new_devices:
async_add_entities(new_devices, update_before_add=True)
async_add_entities(new_devices)

class ComwattSensor(SensorEntity):
@property
Expand Down
2 changes: 1 addition & 1 deletion custom_components/comwatt/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
# TODO: Remove existing devices?
# TODO: Remove old existing devices?
if new_devices:
async_add_entities(new_devices, update_before_add=True)
async_add_entities(new_devices)


class ComwattSwitch(SwitchEntity):
Expand Down

0 comments on commit a989da7

Please sign in to comment.