Skip to content

Commit

Permalink
Deal with the tri-mode heatstate of the BP2100 as mentioned in #1
Browse files Browse the repository at this point in the history
  • Loading branch information
garbled1 committed May 24, 2020
1 parent 2403af1 commit 541df73
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pybalboa/balboa.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
]

text_heatmode = ["Ready", "Ready in Rest", "Rest"]
text_heatstate = ["Idle", "Heating", "Heat Waiting"]
text_tscale = ["Farenheit", "Celcius"]
text_timescale = ["12h", "24h"]
text_pump = ["Off", "Low", "High"]
Expand Down Expand Up @@ -120,6 +121,9 @@ def __init__(self, hostname, port=BALBOA_DEFAULT_PORT):
self.FILTER_1_2 = 3
self.OFF = 0
self.ON = 1
self.HEATSTATE_IDLE = 0
self.HEATSTATE_HEATING = 1
self.HEATSTATE_HEAT_WAITING = 2

# Internal states
self.host = hostname
Expand Down Expand Up @@ -690,7 +694,7 @@ async def parse_status_update(self, data):
self.filter_mode = (data[14] & 0x0c) >> 2

# flag 4 heating, temp range
self.heatstate = int(((data[15] & 0x30) >> 4) != 0)
self.heatstate = (data[15] & 0x30) >> 4
self.temprange = (data[15] & 0x04) >> 2

for i in range(0, 6):
Expand Down Expand Up @@ -922,7 +926,7 @@ def get_heatmode(self, text=False):
def get_heatstate(self, text=False):
""" Ask for the current heat state. """
if text:
return text_switch[self.heatstate]
return text_heatstate[self.heatstate]
return self.heatstate

def get_temprange(self, text=False):
Expand Down

0 comments on commit 541df73

Please sign in to comment.