Package: aioswitcher
Help WantedAioswitcher project is looking for maintainers and contributors!For various reasons, I can only keep maintaining this project as far as dependency bumps and publishing.As for new features and the occasional bug support, these will require other maintainers/contributors.If that's you - please feel free to ping me and I will do all I can to make the onboarding process easy.Switcher Python IntegrationPyPi module integrating with variousSwitcherdevices.Check out thewiki pagesfor a list of supported devices.pipinstallaioswitcherDocumentationWikiContributingExample UsageState Bridgeasyncdefprint_devices(delay):defon_device_found_callback(device):# a switcher device will broadcast a state message approximately every 4 secondsprint(asdict(device))asyncwithSwitcherBridge(on_device_found_callback):awaitasyncio.sleep(delay)# run the bridge for 60 secondsasyncio.run(print_devices(60))Power Plug APIasyncdefcontrol_power_plug(device_ip,device_id,device_key):# for connecting to a device we need its id, login key and ip addressasyncwithSwitcherType1Api(device_ip,device_id,device_key)asapi:# get the device current stateawaitapi.get_state()# turn the device onawaitapi.control_device(Command.ON)# turn the device offawaitapi.control_device(Command.OFF)# set the device name to 'my new name'awaitapi.set_device_name("my new name")asyncio.run(control_power_plug("111.222.11.22","ab1c2d","00"))Water Heater APIasyncdefcontrol_water_heater(device_ip,device_id,device_key):# for connecting to a device we need its id, login key and ip addressasyncwithSwitcherType1Api(device_ip,device_id,device_key)asapi:# get the device current stateawaitapi.get_state()# turn the device on for 15 minutesawaitapi.control_device(Command.ON,15)# turn the device offawaitapi.control_device(Command.OFF)# set the device name to 'my new name'awaitapi.set_device_name("my new name")# configure the device for 02:30 auto shutdownawaitapi.set_auto_shutdown(timedelta(hours=2,minutes=30))# get the schedules from the deviceawaitapi.get_schedules()# delete and existing schedule with id 1awaitapi.delete_schedule("1")# create a new recurring schedule for 13:00-14:30# executing on sunday and fridayawaitapi.create_schedule("13:00","14:30",{Days.SUNDAY,Days.FRIDAY})asyncio.run(control_water_heater("111.222.11.22","ab1c2d","00"))Runner APIasyncdefcontrol_runner(device_ip,device_id,device_key):# for connecting to a device we need its id, login key and ip addressasyncwithSwitcherType2Api(device_ip,device_id,device_key)asapi:# get the device current stateawaitapi.get_shutter_state()# open the shutter to 30%awaitapi.set_position(30)# stop the shutter if currently rollingawaitapi.stop()asyncio.run(control_runner("111.222.11.22","ab1c2d","00"))Breeze APIasyncdefcontrol_breeze(device_ip,device_id,device_key,remote_manager,remote_id):# for connecting to a device we need its id, login key and ip addressasyncwithSwitcherType2Api(device_ip,device_id,device_key)asapi:# get the device current stateawaitapi.get_breeze_state()# initialize the Breeze RemoteManager and get the remoteremote=remote_manager.get_remote(remote_id)# prepare a control command that turns on the Breeze# set to 24 degree (Celsius) cooling with vertical swing# send command to the deviceawaitapi.control_breeze_device(remote,DeviceState.ON,ThermostatMode.COOL,24,ThermostatFanLevel.MEDIUM,ThermostatSwing.ON,)# create the remote manager outside the context for re-usingremote_manager=SwitcherBreezeRemoteManager()asyncio.run(control_breeze("111.222.11.22","ab1c2d","00",remote_manager,"DLK65863"))Command Line Helper Scriptsdiscover_devices.pycan discover devices and their
states.control_device.pycan control a device.DisclaimerThis isNOTan official module and it isNOTofficially supported by the vendor.That said, thanks are in order to all the people atSwitcherfor their cooperation and general support.ContributorsThanks goes to these wonderful people (emoji key):Aviad Golan🔣Dolev Ben Aharon📖Fabian Affolter💻Itzik Ephraim💻Kesav890📖Liad Avraham💻Or Bin💻Shai rod🔣Shay Levy💻🤔YogevBokobza💻⚠️🚧dmatik📝🤔📓jafar-atili💻📖