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
10 changes: 10 additions & 0 deletions PyViCare/PyViCareHeatingDevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,16 @@ def getHeatingSchedule(self):
"sun": properties["entries"]["value"]["sun"]
}

@handleAPICommandErrors
def setHeatingSchedule(self, schedule: dict) -> None:
self.service.setProperty(f"heating.circuits.{self.circuit}.heating.schedule",
"setSchedule", {'newSchedule': schedule})

@handleNotSupported
def getHeatingScheduleModes(self) -> list: # type: ignore[type-arg]
return list(self.getProperty(f"heating.circuits.{self.circuit}.heating.schedule"
)["commands"]["setSchedule"]["params"]["newSchedule"]["constraints"]["modes"])

# Calculates target supply temperature based on data from Viessmann
# See: https://www.viessmann-community.com/t5/Gas/Mathematische-Formel-fuer-Vorlauftemperatur-aus-den-vier/m-p/68890#M27556
def getTargetSupplyTemperature(self) -> Optional[float]:
Expand Down
5 changes: 5 additions & 0 deletions tests/test_Vitocal300G.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,8 @@ def test_coolingCircuit_getType(self):
def test_coolingCircuit_getReverseActive(self):
self.assertEqual(
self.device.coolingCircuits[0].getReverseActive(), False)

def test_getHeatingScheduleModes(self):
expected_modes = {'reduced', 'normal', 'fixed'}
self.assertSetEqual(
set(self.device.circuits[0].getHeatingScheduleModes()), expected_modes)
Loading