Releases: ec-blaster/magicswitchbot-homeassistant
v1.1.1
v1.1.0
New async version based on bleak
and using the native HA bluetooth
integration.
The code has been rewritten from the ground.
v1.0.1
Better exception handling
v1.0.0
Fixed: Now we can set a password to connect to the devices
v0.0.4
Bump to pyMagicSwitchbot 1.0.11 (Better exception catching)
v0.0.3
A lot of changes.
The connection strategy has changed:
- In previous releases, the connection was made at start and tried to be kept active every minute (when we got the battery level) and every time we issued a command to the device.
- Now, there is no connection made until the moment we need to do it. When you:
- Turn on.
- Turn off.
- Call the "push" service.
If no connection is active, the component tries to connect (3 times, for 5 seconds evert attempt) and then execute the command. If the command succeeds, the state of the switch is changed accordingly. If it fails, the state does not change and the attribute last_action
gets the Error
value.
The attribute battery_level
is updated only when a command is executed.
Once the command is executed, the connection stays for 30 seconds. If you don't issue a command in this time, the connection is closed. There's also an attribute connection
that holds a boolean with the current connection status.
This approach has some advantages:
- You can control the device from several points: another HA instance, the original app, etc.
- The connection is established only when needed.
But also it has some cons:
- If the connection is not established when you want to switch on or off the device, it has to connect first, so it is slower.
- You don't have an updated value of the battery if no action is taken on the switch.
I hope it works OK for you.
v0.0.2
This version should be more or less stable and its main goal is to share to testers
First release
v0.0.1 Control connect and auth exceptions