Skip to content

Commit

Permalink
Icon alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Wieskamp committed Aug 31, 2023
1 parent 8a05c4f commit 943b951
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 15 additions & 4 deletions custom_components/glentronics/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ class GlentronicsSensor(Entity):
def parse_results(self,results):
state = not pydash.get(results,f"{self.idx}.FieldStatusOK")
if state:
state="on"
self._state="on"
else:
state = "off"
self._state = state
self._state = "off"
self._attributes["Value"] = pydash.get(results,f"{self.idx}.FieldValue")
self._attributes["Detail"] = pydash.get(results,f"{self.idx}.FieldDetailInfo")
self._attributes["Warning"] = pydash.get(results,f"{self.idx}.IsWarning")
Expand Down Expand Up @@ -66,7 +65,19 @@ def name(self):

@property
def icon(self):
return 'mdi:recycle'
match self.field:
case 'Alarm Status (USB)':
return 'mdi:usb'
case 'High Water Detector Status':
return 'mdi:home-flood'
case 'WiFi Module Status':
return 'mdi:wifi'
case 'Firmware Version (software is up to date)':
return 'mdi:update'
case 'Last Received Alarm from WiFi Module':
return 'mdi:alert'
case _:
return 'mdi:pipe'

@property
def device_class(self):
Expand Down
2 changes: 1 addition & 1 deletion custom_components/glentronics/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"issue_tracker": "https://github.com/theOrakle/glentronics/issues",
"loggers": ["custom_components.glentronics"],
"requirements": ["pydash"],
"version": "0.1.0",
"version": "0.1.1",
"dependencies": [],
"codeowners": ["@theOrakle"]
}

0 comments on commit 943b951

Please sign in to comment.