Skip to content

Commit

Permalink
Merge pull request #229 from gjohansson-ST/gj-20241113-5
Browse files Browse the repository at this point in the history
Don't refresh on platform add
  • Loading branch information
gjohansson-ST authored Nov 13, 2024
2 parents 403ac94 + c67df56 commit 7a0f78a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion custom_components/sector/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ async def async_setup_entry(
):
"""Set up Sector Alarm binary sensors."""
coordinator = entry.runtime_data
await coordinator.async_refresh()
devices: dict[str, Any] = coordinator.data.get("devices", {})
entities: list[
SectorAlarmBinarySensor
Expand Down
4 changes: 1 addition & 3 deletions custom_components/sector/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import logging
from datetime import datetime, timezone

from homeassistant.components.event import EventEntity
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
Expand All @@ -19,9 +20,6 @@ async def async_setup_entry(
):
"""Set up Sector Alarm event entities."""
coordinator: SectorDataUpdateCoordinator = entry.runtime_data
await (
coordinator.async_refresh()
) # Ensure data is up-to-date before creating entities
devices = coordinator.data.get("devices", {})
logs = coordinator.data.get("logs", {})
entities = []
Expand Down
1 change: 0 additions & 1 deletion custom_components/sector/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ async def async_setup_entry(
):
"""Set up Sector Alarm sensors."""
coordinator = entry.runtime_data
await coordinator.async_refresh()
devices = coordinator.data.get("devices", {})
entities: list[SectorAlarmSensor] = []

Expand Down

0 comments on commit 7a0f78a

Please sign in to comment.