Skip to content

Commit

Permalink
Fixed WiFi Connection Status
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Wieskamp committed Feb 8, 2024
1 parent aaac54e commit 12d6b52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions custom_components/glentronics/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ class GlentronicsSensor(Entity):

def parse_results(self,results):
state = pydash.get(results,f"{self.idx}.FieldStatusOK")
if bool(state) and not self.field.find("WiFi") == 0:
self._state="off"
if bool(state):
if not self.field.find("WiFi") == 0:
self._state = "off"
else:
self._state = "on"
else:
self._state = "on"
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
4 changes: 2 additions & 2 deletions custom_components/glentronics/manifest.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"domain": "glentronics",
"name": "Glentronics API",
"name": "Glentronics",
"documentation": "https://github.com/theOrakle/glentronics",
"config_flow": true,
"integration_type": "hub",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/theOrakle/glentronics/issues",
"loggers": ["custom_components.glentronics"],
"requirements": ["pydash"],
"version": "0.1.3",
"version": "0.1.4",
"dependencies": [],
"codeowners": ["@theOrakle"]
}

0 comments on commit 12d6b52

Please sign in to comment.