Skip to content

Commit

Permalink
temp state for UDM-pro
Browse files Browse the repository at this point in the history
1. added function to get tempereatures from UDM-pro machine w ssh and sensors -u command
  • Loading branch information
kw123 committed Jul 7, 2020
1 parent eabae61 commit cd13abd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion uniFiAP.indigoPlugin/Contents/Info.plist
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>PluginVersion</key>
<string>7.30.249</string>
<string>7.30.250</string>
<key>ServerApiVersion</key>
<string>2.0.0</string>
<key>IwsApiVersion</key>
Expand Down
23 changes: 7 additions & 16 deletions uniFiAP.indigoPlugin/Contents/Server Plugin/plugin.py
Expand Up @@ -5370,24 +5370,15 @@ def getUDMpro_sensors(self):
temperature_Board_PHY = ""
for dd in data0:
if dd.find(":") == -1: continue
if dd[0] != " ":
nextItem = dd.strip().split(":")[0]
continue
if nextItem not in ["temp1","temp3","Board Temp"]: continue
nn = dd.strip().split(":")
if nextItem == "Board Temp":
if nn[0] == "temp2_input":
temperature_Board_CPU = round(float(nn[1]),1)
nextItem = ""
elif nextItem == "temp1":
if nn[0] == "temp1_input":
temperature = round(float(nn[1]))
nextItem = ""
elif nextItem == "temp3":
if nn[0] == "temp3_input":
temperature_Board_PHY = round(float(nn[1]))
nextItem = ""
if nn[0] == "temp2_input":
temperature_Board_CPU = round(float(nn[1]),1)
elif nn[0] == "temp1_input":
temperature = round(float(nn[1]),1)
elif nn[0] == "temp3_input":
temperature_Board_PHY = round(float(nn[1]),1)

if True or self.decideMyLog(u"Expect"): self.indiLOG.log(20,"temp values found: 1:{}, 2:{}, 3:{}".format(temperature, temperature_Board_CPU, temperature_Board_PHY) )
for dev in indigo.devices.iter("props.isGateway"):
if dev.states[u"temperature"] != temperature and temperature != "": self.addToStatesUpdateList(dev.id,u"temperature", temperature)
if dev.states[u"temperature_Board_CPU"] != temperature_Board_CPU and temperature_Board_CPU != "": self.addToStatesUpdateList(dev.id,u"temperature_Board_CPU", temperature_Board_CPU)
Expand Down
2 changes: 1 addition & 1 deletion uniFiAP.indigoPlugin/Contents/changeLog.txt
@@ -1,4 +1,4 @@
changes in V 7.31.249 @ 2019-07-07
changes in V 7.31.250 @ 2019-07-07
==================

1. added function to get tempereatures from UDM-pro machine w ssh and sensors -u command
Expand Down

0 comments on commit cd13abd

Please sign in to comment.