@@ -42,6 +42,9 @@ async def main(args):
4242 elif args .action == "set-comfocool" :
4343 await run_set_comfocool (args .host , args .uuid , args .mode )
4444
45+ elif args .action == "set-boost" :
46+ await run_set_boost (args .host , args .uuid , args .mode , args .timeout )
47+
4548 elif args .action == "show-sensors" :
4649 await run_show_sensors (args .host , args .uuid )
4750
@@ -197,6 +200,26 @@ async def run_set_comfocool(host: str, uuid: str, mode: Literal["auto", "off"]):
197200 await comfoconnect .disconnect ()
198201
199202
203+ async def run_set_boost (host : str , uuid : str , mode : Literal ["on" , "off" ], timeout : int ):
204+ """Set boost."""
205+ # Discover bridge so we know the UUID
206+ bridges = await discover_bridges (host )
207+ if not bridges :
208+ raise Exception ("No bridge found" )
209+
210+ # Connect to the bridge
211+ comfoconnect = ComfoConnect (bridges [0 ].host , bridges [0 ].uuid )
212+ try :
213+ await comfoconnect .connect (uuid )
214+ except ComfoConnectNotAllowed :
215+ print ("Could not connect to bridge. Please register first." )
216+ sys .exit (1 )
217+
218+ await comfoconnect .set_boost (mode == "on" , timeout )
219+
220+ await comfoconnect .disconnect ()
221+
222+
200223async def run_show_sensors (host : str , uuid : str ):
201224 """Show all sensors."""
202225 # Discover bridge so we know the UUID
@@ -391,6 +414,12 @@ async def run_set_flow_for_speed(host: str, uuid: str, speed: Literal["away", "l
391414 p_set_mode .add_argument ("--host" , help = "Host address of the bridge" )
392415 p_set_mode .add_argument ("--uuid" , help = "UUID of this app" , default = DEFAULT_UUID )
393416
417+ p_set_boost = subparsers .add_parser ("set-boost" , help = "trigger or cancel a boost" )
418+ p_set_boost .add_argument ("mode" , help = "Boost mode" , choices = ["on" , "off" ])
419+ p_set_boost .add_argument ("--host" , help = "Host address of the bridge" )
420+ p_set_boost .add_argument ("--uuid" , help = "UUID of this app" , default = DEFAULT_UUID )
421+ p_set_boost .add_argument ("--timeout" , "-t" , help = "Timeout in seconds" , type = int , default = 600 )
422+
394423 p_sensors = subparsers .add_parser ("show-sensors" , help = "show the sensor values" )
395424 p_sensors .add_argument ("--host" , help = "Host address of the bridge" )
396425 p_sensors .add_argument ("--uuid" , help = "UUID of this app" , default = DEFAULT_UUID )
0 commit comments