@@ -193,15 +193,19 @@ def _get_device_data(self, dev_id: str) -> dict[str, Any]:
193193
194194 # Generic
195195 if details .get ("class" ) == "gateway" or dev_id == self .gateway_id :
196- # Adam & Anna: the Smile outdoor_temperature is present in DOMAIN_OBJECTS and LOCATIONS - under Home
197- # The outdoor_temperature present in APPLIANCES is a local sensor connected to the active device
198196 if self .smile_type == "thermostat" :
197+ # Adam & Anna: the Smile outdoor_temperature is present in DOMAIN_OBJECTS and LOCATIONS - under Home
198+ # The outdoor_temperature present in APPLIANCES is a local sensor connected to the active device
199199 outdoor_temperature = self ._object_value (
200200 self ._home_location , "outdoor_temperature"
201201 )
202202 if outdoor_temperature is not None :
203203 device_data ["outdoor_temperature" ] = outdoor_temperature
204204
205+ if self .smile_name == "Adam" :
206+ # Show the allowed regulation modes
207+ device_data ["regulation_modes" ] = self ._allowed_modes
208+
205209 # Get P1 data from LOCATIONS
206210 power_data = self ._power_data_from_location (details .get ("location" ))
207211 if power_data is not None :
@@ -565,7 +569,6 @@ async def set_preset(self, loc_id: str, preset: str) -> bool:
565569
566570 async def set_temperature (self , loc_id : str , temperature : str ) -> bool :
567571 """Set the given Temperature on the relevant Thermostat."""
568- temperature = str (temperature )
569572 uri = self ._thermostat_uri (loc_id )
570573 data = (
571574 "<thermostat_functionality><setpoint>"
@@ -575,6 +578,19 @@ async def set_temperature(self, loc_id: str, temperature: str) -> bool:
575578 await self ._request (uri , method = "put" , data = data )
576579 return True
577580
581+ async def set_max_boiler_temperature (self , temperature : str ) -> bool :
582+ """Set the max. Boiler Temperature on the Central heating boiler."""
583+ locator = f'appliance[@id="{ self ._heater_id } "]/actuator_functionalities/thermostat_functionality'
584+ th_func = self ._appliances .find (locator )
585+ if th_func .find ("type" ).text == "maximum_boiler_temperature" :
586+ thermostat_id = th_func .attrib ["id" ]
587+
588+ uri = f"{ APPLIANCES } ;id={ self ._heater_id } /thermostat;id={ thermostat_id } "
589+ data = f"<thermostat_functionality><setpoint>{ temperature } </setpoint></thermostat_functionality>"
590+
591+ await self ._request (uri , method = "put" , data = data )
592+ return True
593+
578594 async def _set_groupswitch_member_state (
579595 self , members : list [str ] | None , state : str , switch : Munch
580596 ) -> bool :
@@ -636,6 +652,20 @@ async def set_switch_state(
636652 await self ._request (uri , method = "put" , data = data )
637653 return True
638654
655+ async def set_regulation_mode (self , mode : str ) -> bool :
656+ """Set the heating regulation mode."""
657+ if mode not in self ._allowed_modes :
658+ return False
659+
660+ uri = f"{ APPLIANCES } ;type=gateway/regulation_mode_control"
661+ duration = ""
662+ if "bleeding" in mode :
663+ duration = "<duration>300</duration>"
664+ data = f"<regulation_mode_control_functionality>{ duration } <mode>{ mode } </mode></regulation_mode_control_functionality>"
665+
666+ await self ._request (uri , method = "put" , data = data )
667+ return True
668+
639669 async def delete_notification (self ) -> bool :
640670 """Delete the active Plugwise Notification."""
641671 uri = NOTIFICATIONS
0 commit comments