Skip to content

Commit

Permalink
Add type conversation to initial currentState to fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pfink authored Oct 23, 2024
1 parent 2a9a5b5 commit 13fb9d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nuimo_openhab/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def handleSliders(self, rotationOffset):
logging.debug("New Rotation Action" + widget["item"]["name"] + "/state")
item = self.openhab.get_item(widget["item"]["name"])
if(item.is_state_null() or item.is_state_undef()):
currentState = config["initial_command"]["Dimmer"]
currentState = float(config["initial_command"]["Dimmer"])
else:
currentState = float(item.state)
if currentState <= 0:
Expand Down Expand Up @@ -156,4 +156,4 @@ def handleSliders(self, rotationOffset):
if widget["sendFrequency"] != 0:
threading.Timer(widget["sendFrequency"]/1000, self.handleSliders, [0]).start()

return self.lastSliderState
return self.lastSliderState

0 comments on commit 13fb9d8

Please sign in to comment.