Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2 from elmigbot/elmigbot-patch-1
Browse files Browse the repository at this point in the history
Elmigbot patch 1
  • Loading branch information
elmigbot authored Dec 12, 2019
2 parents 2a190c2 + 25b82bd commit e244c70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion custom_components/huesensor/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def name(self):
@property
def unique_id(self):
"""Return the ID of this Hue sensor."""
return self._hue_id[+4:][:-3]
return self._hue_id

@property
def is_on(self):
Expand Down
15 changes: 8 additions & 7 deletions custom_components/huesensor/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,17 @@ def parse_hue_api_response(sensors):
# Loop over all keys (1,2 etc) to identify sensors and get data.
for sensor in sensors:
modelid = sensor["modelid"][0:3]
if modelid in ["RWL", "ROM", "SML", "ZGP"]:
if modelid in ["RWL", "ROM", "SML"]:
_key = modelid + "_" + sensor["uniqueid"][:-5]
if modelid == "RWL" or modelid == "ROM":
data_dict[_key] = parse_rwl(sensor)
elif modelid == "ZGP":
data_dict[_key] = parse_zgp(sensor)

elif modelid == "FOH": ############# New Model ID
_key = modelid + "_" + sensor["uniqueid"][-5:] ###needed for uniqueness
data_dict[_key] = parse_foh(sensor)
elif modelid in ["FOH", "ZGP"]: ############# New Model ID
_key = modelid + "_" + sensor["uniqueid"][-14:-3] ###needed for uniqueness
if modelid == "FOH":
data_dict[_key] = parse_foh(sensor)
elif modlid == "ZGP":
data_dict[_key] = parse_zgp(sensor)

elif modelid == "Z3-": #### Newest Model ID / Lutron Aurora / Hue Bridge treats it as two sensors, I wanted them combined
if sensor["type"] == "ZLLRelativeRotary": # Rotary Dial
Expand Down Expand Up @@ -340,7 +341,7 @@ def name(self):
@property
def unique_id(self):
"""Return the ID of this Hue sensor."""
return self._hue_id[+4:][:-3]
return self._hue_id

@property
def state(self):
Expand Down

0 comments on commit e244c70

Please sign in to comment.