Skip to content

Commit

Permalink
Fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Sateetje authored Dec 17, 2023
1 parent a107beb commit 8f5b379
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def onStart(self):
Domoticz.Device(Name="Setpoint cooling",Unit=50,Type=242,Subtype=1,Options=Options,Used=1).Create()
Options = {"LevelActions": "|| ||", "LevelNames": "Off|Normal|Demand|Interval", "LevelOffHidden": "true", "SelectorStyle": "1"}
if 51 not in Devices:
Domoticz.Device(Name="Pomp mode",Unit=51,TypeName="Selector Switch",Options=Options,Image=11,Used=1).Create()
Domoticz.Device(Name="Pump mode",Unit=51,TypeName="Selector Switch",Options=Options,Image=11,Used=1).Create()

def onStop(self):
Domoticz.Log("SPRSUN-Modbus plugin stop")
Expand Down Expand Up @@ -227,7 +227,7 @@ def onHeartbeat(self):
SP_Heating_Eco_Mode = 0
SP_Hot_Water_Eco_Mode = 0
SP_Cooling = 0
Pomp_Mode = 0
Pump_Mode = 0

# Get data from SPRSUN
try:
Expand Down Expand Up @@ -298,7 +298,7 @@ def onHeartbeat(self):
Eco_Mode_Hot_Water_Y3 = self.rs485.read_register(296,1,3,True)
Eco_Mode_Hot_Water_Y4 = self.rs485.read_register(338,1,3,True)
SP_Cooling = self.rs485.read_register(2,1,3,False)
Pomp_Mode = self.rs485.read_register(11,0,3,False)
Pump_Mode = self.rs485.read_register(11,0,3,False)

#Convert State to Text
if Status == 0:
Expand Down Expand Up @@ -441,7 +441,7 @@ def onHeartbeat(self):
Devices[48].Update(nValue=int(SP_Heating_Eco_Mode),sValue=str(SP_Heating_Eco_Mode))
Devices[49].Update(nValue=int(SP_Hot_Water_Eco_Mode),sValue=str(SP_Hot_Water_Eco_Mode))
Devices[50].Update(nValue=int(SP_Cooling),sValue=str(SP_Cooling))
Devices[51].Update(nValue=int((Pomp_Mode+1)*10),sValue=str((Pomp_Mode+1)*10))
Devices[51].Update(nValue=int((Pump_Mode+1)*10),sValue=str((Pump_Mode+1)*10))

self.runInterval = 1 # Success so call again in 1x10 seconds.
Domoticz.Heartbeat(10) # Sucesss so set Heartbeat to 10 second intervals.
Expand Down Expand Up @@ -498,7 +498,7 @@ def onHeartbeat(self):
Domoticz.Log('Setpoint heating eco mode: {0:.1f}'.format(SP_Heating_Eco_Mode))
Domoticz.Log('Setpoint hot water eco mode: {0:.1f}'.format(SP_Hot_Water_Eco_Mode))
Domoticz.Log('Cooling setpoint: {0:.1f}'.format(SP_Cooling))
Domoticz.Log('Pomp mode: {0}'.format(Pomp_Mode))
Domoticz.Log('Pump mode: {0}'.format(Pump_Mode))

def onCommand(self, Unit, Command, Level, Hue):
Domoticz.Log("Something changed for " + Devices[Unit].Name + ", DeviceID = " + str(Unit) + ". New setpoint: " + str(Level) + ". New Command: " + Command)
Expand Down Expand Up @@ -549,7 +549,7 @@ def onCommand(self, Unit, Command, Level, Hue):
nValue=int(Level)
self.settingsToWrite.append(SettingToWrite(2,float(Level),1,False,False))
elif Unit == 51:
#Pomp mode
#Pump mode
self.settingsToWrite.append(SettingToWrite(11,int((Level/10)-1),0,False,False))

Devices[Unit].Update(nValue=nValue, sValue=sValue)
Expand Down

0 comments on commit 8f5b379

Please sign in to comment.