Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
add unique_id property to the covers
Browse files Browse the repository at this point in the history
  • Loading branch information
nagyrobi authored Apr 25, 2021
1 parent 96fd7f5 commit de84c03
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion custom_components/cover_rf_time_based/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def __init__(self, device_id, name, travel_time_down, travel_time_up, open_scrip
self._assume_uncertain_position = True
self._target_position = 0
self._processing_known_position = False
self._unique_id = device_id

if name:
self._name = name
Expand Down Expand Up @@ -174,6 +175,11 @@ def name(self):
"""Return the name of the cover."""
return self._name

@property
def unique_id(self):
"""Return the unique id."""
return "cover_rf_timebased_uuid_" + self._unique_id

@property
def device_state_attributes(self):
"""Return the device state attributes."""
Expand Down Expand Up @@ -370,6 +376,8 @@ async def _async_handle_command(self, command, *args):
await self.hass.services.async_call("homeassistant", "turn_on", {"entity_id": self._stop_script_entity_id}, False)

_LOGGER.debug(self._name + ': ' + '_async_handle_command :: %s', cmd)

# Update state of entity
self.async_write_ha_state()

# END

0 comments on commit de84c03

Please sign in to comment.