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

Commit

Permalink
Update sensor.py
Browse files Browse the repository at this point in the history
  • Loading branch information
elmigbot authored Dec 12, 2019
1 parent 8ab113e commit 25b82bd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 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

0 comments on commit 25b82bd

Please sign in to comment.