Skip to content
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ $ python -m aiocomfoconnect set-speed low --host 192.168.1.213
$ python -m aiocomfoconnect set-mode auto --host 192.168.1.213
$ python -m aiocomfoconnect set-speed medium --host 192.168.1.213
$ python -m aiocomfoconnect set-speed high --host 192.168.1.213
$ python -m aiocomfoconnect set-boost on --host 192.168.1.213 --timeout 1200

$ python -m aiocomfoconnect show-sensors --host 192.168.1.213
$ python -m aiocomfoconnect show-sensor 276 --host 192.168.1.213
Expand Down
29 changes: 29 additions & 0 deletions aiocomfoconnect/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ async def main(args):
elif args.action == "set-comfocool":
await run_set_comfocool(args.host, args.uuid, args.mode)

elif args.action == "set-boost":
await run_set_boost(args.host, args.uuid, args.mode, args.timeout)

elif args.action == "show-sensors":
await run_show_sensors(args.host, args.uuid)

Expand Down Expand Up @@ -197,6 +200,26 @@ async def run_set_comfocool(host: str, uuid: str, mode: Literal["auto", "off"]):
await comfoconnect.disconnect()


async def run_set_boost(host: str, uuid: str, mode: Literal["on", "off"], timeout: int):
"""Set boost."""
# Discover bridge so we know the UUID
bridges = await discover_bridges(host)
if not bridges:
raise Exception("No bridge found")

# Connect to the bridge
comfoconnect = ComfoConnect(bridges[0].host, bridges[0].uuid)
try:
await comfoconnect.connect(uuid)
except ComfoConnectNotAllowed:
print("Could not connect to bridge. Please register first.")
sys.exit(1)

await comfoconnect.set_boost(mode == "on", timeout)

await comfoconnect.disconnect()


async def run_show_sensors(host: str, uuid: str):
"""Show all sensors."""
# Discover bridge so we know the UUID
Expand Down Expand Up @@ -391,6 +414,12 @@ async def run_set_flow_for_speed(host: str, uuid: str, speed: Literal["away", "l
p_set_mode.add_argument("--host", help="Host address of the bridge")
p_set_mode.add_argument("--uuid", help="UUID of this app", default=DEFAULT_UUID)

p_set_boost = subparsers.add_parser("set-boost", help="trigger or cancel a boost")
p_set_boost.add_argument("mode", help="Boost mode", choices=["on", "off"])
p_set_boost.add_argument("--host", help="Host address of the bridge")
p_set_boost.add_argument("--uuid", help="UUID of this app", default=DEFAULT_UUID)
p_set_boost.add_argument("--timeout", "-t", help="Timeout in seconds", type=int, default=600)

p_sensors = subparsers.add_parser("show-sensors", help="show the sensor values")
p_sensors.add_argument("--host", help="Host address of the bridge")
p_sensors.add_argument("--uuid", help="UUID of this app", default=DEFAULT_UUID)
Expand Down