Skip to content

Commit

Permalink
Bugfix: remove self, fix register datatype for PelletsBoiler (#22)
Browse files Browse the repository at this point in the history
* add pellet stats
* remove self in arguments to fix TypeError
* fix pellets usage signals, update example
  • Loading branch information
lein1013 authored Feb 22, 2023
1 parent c2b8779 commit bef1011
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Create the Solarfocus API client
# TODO: Adapt IP-Address
solarfocus = SolarfocusAPI(ip="IP-Address", system=Systems.Vampair)
solarfocus = SolarfocusAPI(ip="IP-Address", system=Systems.Therminator)
solarfocus.connect()
# Fetch the values
solarfocus.update()
Expand All @@ -14,6 +14,8 @@
print("\n")
print(solarfocus.buffers[0])
print("\n")
print(solarfocus.pelletsboiler)
print("\n")
print(solarfocus.heatpump)
print("\n")
print(solarfocus.photovoltaic)
Expand Down
10 changes: 5 additions & 5 deletions pysolarfocus/components/pellets_boiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class PelletsBoiler(Component):
def __init__(self,input_address=2400,holding_address=33400) -> None:
super().__init__(self,input_address, holding_address)
super().__init__(input_address, holding_address)
self.temperature = DataValue(address=0,multiplier=0.1)
self.status = DataValue(address=1,type=DataTypes.UINT)
self.message_number = DataValue(address=4)
Expand All @@ -16,7 +16,7 @@ def __init__(self,input_address=2400,holding_address=33400) -> None:
self.octoplus_buffer_temperature_bottom = DataValue(address=10,multiplier=0.1)
self.octoplus_buffer_temperature_top = DataValue(address=11,multiplier=0.1)
self.log_wood = DataValue(address=12,type=DataTypes.UINT)
self.pellet_usage_last_fill = DataValue(address=14,type=DataTypes.UINT,multiplier=0.1)
self.pellet_usage_total = DataValue(address=16,type=DataTypes.UINT,multiplier=0.1)
self.heat_energy_total = DataValue(address=18,type=DataTypes.UINT,multiplier=0.1)
self.pellet_usage_reset = DataValue(address=12,type=DataTypes.UINT,register_type=RegisterTypes.Holding)
self.pellet_usage_last_fill = DataValue(address=14,count=2,multiplier=0.1)
self.pellet_usage_total = DataValue(address=16,count=2,multiplier=0.1)
self.heat_energy_total = DataValue(address=18,count=2,multiplier=0.1)
self.pellet_usage_reset = DataValue(address=12,register_type=RegisterTypes.Holding)

0 comments on commit bef1011

Please sign in to comment.