Switcher Python Integration.
Project description
Switcher Python Integration
PyPi module integrating with various Switcher devices.
Check out the wiki pages for a list of supported devices.
Install
pip install aioswitcher
Usage Example
async with SwitcherApi(device_ip, device_id) as swapi:
# get the device state
state_response = await swapi.get_state()
# control the device on for 15 minutes and then turn it off
await swapi.control_device(Command.ON, 15)
await swapi.control_device(Command.OFF)
# create a new recurring schedule
await swapi.create_schedule("13:00", "14:30", {Days.SUNDAY, Days.FRIDAY})
# control Type 2 devices such as Breeze, Runner and Runner Mini
# control a breeze device
async with SwitcherType2Api(device_ip, device_id) as api_type2:
# get the Breeze device state
resp: SwitcherThermostatStateResponse = await api_type2.get_breeze_state()
# initialize the Breeze RemoteManager
rm = BreezeRemoteManager()
# get the remote structure
remote: BreezeRemote = rm.get_remote(resp.remote_id)
# prepare a control command that turns on the Breeze
# (24 degree (Celsius), cooling and high Fan level with vertical swing)
command = remote.get_command(
DeviceState.ON,
ThermostatMode.COOL,
24,
ThermostatFanLevel.HIGH,
ThermostatSwing.ON,
resp.state
)
# send command to the device
await api_type2.control_breeze_device(command)
# control Runner device
async with SwitcherType2Api(device_ip, device_id) as api:
# get the runner state
state_response: SwitcherShutterStateResponse = api.get_shutter_state()
# open the shutter all the way up
await api.set_position(100)
# stop the shutter from rolling
await api.stop()
# set the shutter position to 30% opened
await api.set_position(30)
# close the shutter all the way down
await api.set_position(0)
Check out the documentation for a more detailed usage section.
Command Line Helper Scripts
- discover_devices.py can discover devices and their states.
- control_device.py can control a device.
Contributing
The contributing guidelines are here
Code of Conduct
The code of conduct is here
Disclaimer
This is NOT an official module and it is NOT officially supported by the vendor.
That said, thanks are in order to all the people at Switcher for their cooperation and general support.
Contributors
Thanks goes to these wonderful people (emoji key):
Aviad Golan 🔣 |
Dolev Ben Aharon 📖 |
Fabian Affolter 💻 |
Or Bin 💻 |
Shai rod 🔣 |
Shay Levy 💻 🤔 🚧 |
dmatik 📝 🤔 📓 |
jafar-atili 💻 📖 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aioswitcher-3.0.0.tar.gz
(518.6 kB
view details)
Built Distribution
aioswitcher-3.0.0-py3-none-any.whl
(556.1 kB
view details)
File details
Details for the file aioswitcher-3.0.0.tar.gz
.
File metadata
- Download URL: aioswitcher-3.0.0.tar.gz
- Upload date:
- Size: 518.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.10.6 Linux/5.15.0-1019-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dccc539e7462a2422f722f4ea7b45c21cd60a33e81263053e7b6c019eb17fc8d |
|
MD5 | 56f1d76b9fe67fe9a61796776a540cad |
|
BLAKE2b-256 | 59d9410c7b0bffcd8392df22f44d1f509e014398fa630f1d616dc3400b683225 |
File details
Details for the file aioswitcher-3.0.0-py3-none-any.whl
.
File metadata
- Download URL: aioswitcher-3.0.0-py3-none-any.whl
- Upload date:
- Size: 556.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.10.6 Linux/5.15.0-1019-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 250e11dd6abb9a7714a929067cb092954f32b705a759219c85eefd4b4d1fefe8 |
|
MD5 | 9a19548399fc73b31cac66ddbf6ed955 |
|
BLAKE2b-256 | 5b67c350baa795dd559fff519e2a68bd3e2eb18b090e5fe58f901836df8db511 |