Skip to content

Commit

Permalink
Added Unique ID
Browse files Browse the repository at this point in the history
It's now possible to select an area for your AC's
  • Loading branch information
svlsbrg authored Sep 5, 2021
1 parent 3f95b4e commit 663dd2d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions custom_components/gree/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ def __init__(self, hass, name, ip_addr, port, mac_addr, timeout, target_temp_ste
_LOGGER.info('Setting up air entity: ' + str(air_entity_id))
async_track_state_change(
hass, air_entity_id, self._async_air_entity_state_changed)

self._unique_id = 'climate.gree_' + mac_addr.decode('utf-8').lower()

# Pad helper method to help us get the right string for encrypting
def Pad(self, s):
Expand Down Expand Up @@ -805,3 +807,8 @@ def set_hvac_mode(self, hvac_mode):
def async_added_to_hass(self):
_LOGGER.info('Gree climate device added to hass()')
self.SyncState()

@property
def unique_id(self):
# Return unique_id
return self._unique_id

0 comments on commit 663dd2d

Please sign in to comment.