Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions luxtronik/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,112 @@ def to_heatpump(cls, value):

return val

class HeatPumpState(SelectionBase):
"""HeatPumpState datatype, converts from and to list of HeatPumpState codes."""

datatype_class = "selection"

codes = {
0: "Idle", # Heatpump is idle
1: "Running", # Heatpump is running
}

class ModeState(SelectionBase):
"""ModeState datatype, converts from and to list of ModeState codes."""

datatype_class = "selection"

codes = {
0: "Disabled", # Heating / Hot water is disabled
1: "No request", # Heating / Hot water currently not requested
2: "Requested", # Heating / Hot water requested but currently not running
3: "Running", # Heating / Hot water running
}

class ControlMode(SelectionBase):
"""ControlMode datatype, converts from and to list of ControlMode codes."""

datatype_class = "selection"

codes = {
0: "Off", # System value is used
1: "Setpoint", # Setpoint register value is used
2: "Offset", # System values + offset register value is used
3: "Level", # System values + smart-home-interface-settings
# register value is used
}


class LpcMode(SelectionBase):
"""LpcMode datatype, converts from and to list of LpcMode codes."""

datatype_class = "selection"

codes = {
0: "No limit",
1: "Soft limit",
2: "Hard limit",
}


class LockMode(SelectionBase):
"""LockMode datatype, converts from and to list of LockMode codes."""

datatype_class = "selection"

codes = {
0: "Off", # Function is not locked
1: "On", # Function is locked
}

class OnOffMode(SelectionBase):
"""OnOffMode datatype, converts from and to list of OnOffMode codes."""

datatype_class = "selection"

codes = {
0: "Off", # Function deactivated
1: "On", # Function activated
}

class LevelMode(SelectionBase):
"""LevelMode datatype, converts from and to list of LevelMode codes."""

datatype_class = "selection"

codes = {
0: "Normal", # No correction
1: "Increased", # Increase the temperature by the values
# within the smart-home-interface-settings
# TODO: Function unknown – requires further analysis
2: "Increased2", # Increase the temperature by the values
# within the smart-home-interface-settings
# TODO: Function unknown – requires further analysis
3: "Decreased", # Decrease the temperature by the values
# within the smart-home-interface-settings
# TODO: Function unknown – requires further analysis
}

class PowerLimit(ScalingBase):
"""PowerLimit datatype, converts from and to PowerLimit."""

datatype_class = "power"
datatype_unit = "kW"
scaling_factor = 0.1


class FullVersion(Base):
"""FullVersion datatype, converts from and to a RBEVersion"""

datatype_class = "version"

@classmethod
def from_heatpump(cls, value):
if isinstance(value, list) and len(value) >= 3:
return f"{value[0]}.{value[1]}.{value[2]}"
else:
return "0"


class Unknown(Base):
"""Unknown datatype, fallback for unknown data."""
Expand Down
Loading