Add suport for new device beacon, siren control, eco_mode control, better device event

This commit is contained in:
2022-03-04 15:47:19 +01:00
parent af12cd70e4
commit adb6cef3c7
9 changed files with 432 additions and 54 deletions

View File

@@ -20,14 +20,14 @@ _LOGGER = logging.getLogger(__name__)
async def async_setup_entry(hass, config_entry, async_add_entities): # pylint: disable=W0613
"""Set up Georide tracker based off an entry."""
georide_context = hass.data[GEORIDE_DOMAIN]["context"]
coordoned_trackers = georide_context.get_coordoned_trackers()
coordoned_trackers = georide_context.georide_trackers_coordoned
entities = []
for coordoned_tracker in coordoned_trackers:
tracker_device = coordoned_tracker['tracker_device']
coordinator = coordoned_tracker['coordinator']
entity = GeoRideTrackerEntity(coordinator, tracker_device, hass)
hass.data[GEORIDE_DOMAIN]["devices"][tracker_device.tracker.tracker_id] = coordinator
hass.data[GEORIDE_DOMAIN]["devices"][tracker_device.unique_id] = coordinator
entities.append(entity)
async_add_entities(entities)