Skip to content

Commit

Permalink
Merge pull request #24 from metalblue:fix-invertor-time
Browse files Browse the repository at this point in the history
Add datetime sensor class for Invertor Time sensor
  • Loading branch information
britkat1980 authored May 13, 2023
2 parents fdc6785 + 079e6e0 commit 96c9ec6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion GivTCP/GivLUT.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class GivLUT:
"Battery_Type":GEType("sensor","string","","","",False,False,False),
"Battery_Capacity_kWh":GEType("sensor","","",0,maxBatPower,True,True,False),
"Invertor_Serial_Number":GEType("sensor","string","","","",False,False,False),
"Invertor_Time":GEType("sensor","","","","",False,False,False),
"Invertor_Time":GEType("sensor","datetime","","","",False,False,False),
"Invertor_Max_Rate":GEType("sensor","","",0,maxBatPower,True,False,False),
"Active_Power_Rate":GEType("number","","setActivePowerRate",0,100,True,False,False),
"Invertor_Firmware":GEType("sensor","string","",0,10000,False,False,False),
Expand Down
2 changes: 2 additions & 0 deletions GivTCP/HA_Discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ def create_device_payload(topic,SN):
if GivLUT.entity_type[str(topic).split("/")[-1]].sensorClass=="timestamp":
del(tempObj['unit_of_meas'])
tempObj['device_class']="timestamp"
if GivLUT.entity_type[str(topic).split("/")[-1]].sensorClass=="datetime":
del(tempObj['unit_of_meas'])
if GivLUT.entity_type[str(topic).split("/")[-1]].sensorClass=="string":
del(tempObj['unit_of_meas'])
tempObj['device_class']="enum"
Expand Down

0 comments on commit 96c9ec6

Please sign in to comment.