
Version 2.2.0 ist da und ich freue mich, dass ich endlich Zeit gefunden habe, ein Feature umzusetzen, dass schon sehr lange auf meiner Todo Liste stand: Konfiguration der Ausgangssperre über den Adapter. Über den Zustand control.current_curfew kann man nicht nur die aktuelle Ausgangssperre auslesen, sondern auch setzen. Das ganze geschieht im nachfolgenden JSON Format:
[{"enabled":true|false, "lock_time":"xx:xx", "unlock_time":"xx:xx"}, ...]
Beispiel:
[{"enabled":true, "lock_time":"19:00", "unlock_time":"20:00"}]
würde eine Ausgangssperre von 19 bis 20 Uhr einrichten und aktivieren.
Für die Katzenklappe können so bis zu vier Zeiträume definiert werden, die Haustierklappe unterstützt leider nur einen Zeitraum. In der neuen App (und mit der neuen Api) können auch einzelne Zeiträume deaktiviert werden.
Beispiel:
[{"enabled":true, "lock_time":"19:00", "unlock_time":"20:00"},
{"enabled":false, "lock_time":"21:00", "unlock_time":"22:00"}]
würde eine Ausgangssperre von 19 bis 20 Uhr einrichten und aktivieren und eine von 21 bis 22 Uhr einrichten aber deaktivieren.
Ein- und ausschalten der aktuell konfigurierten Ausgangssperre ist weiterhin möglich, der Zustand heißt jetzt allerdings control.curfew_enabled. Die Kanäle curfew und last_curfew und deren Zustände entfallen und werden durch den bereits erwähnten Zustand control.current_curfew sowie last_enabled_curfew ersetzt, beide im JSON Format.
Auch die Chronik wurde überarbeitet und steht nun ebenfalls im JSON Format unter history.json.0..x bereit. In der Konfiguration kann eingestellt werden, wie viele Ereignisse angezeigt werden (max. 25).
Die alte Chronik, die bei einigen zu hoher Last geführt hat, kann nach wie vor in der Konfiguration aktiviert werden, ist aber als veraltet markiert und wird in einer der nächsten Versionen entfernt. Wer also Skripte laufen hat, die auf die Zustände der alten Chronik zugreifen, sollte diese zeitnah auf die neuen JSON Zustände umstellen.
Außerdem habe ich intern noch einiges refactored und ein wenig aufgeräumt und die Abhängigkeiten aktualisiert.
Insgesamt sind es diesmal also recht umfangreiche Änderungen und speziell die Ausgangssperre konnte ich nur mit meiner Katzenklappe testen und nicht mit einer Haustierklappe.
Daher freue ich auf Feedback zu den neuen Features und ob alles funktioniert, wie es soll!
English:
Version 2.2.0 is here and I'm pleased that I've finally found time to implement a feature that has been on my to-do list for a very long time: configuring the curfew via the adapter. Using the control.current_curfew state, you can not only read the current curfew, but also set it. For this, the following JSON format is used:
[{"enabled":true|false, "lock_time":"xx:xx", "unlock_time":"xx:xx"}, ...]
Example:
[{"enabled":true, "lock_time":"19:00", "unlock_time":"20:00"}]
would set and activate a curfew from 7 pm to 8 pm.
Up to four timespans can be defined for the cat flap; unfortunately, the pet flap supports only one. In the new app (and with the new Api), individual time periods can also be deactivated.
Example:
[{"enabled":true, "lock_time":"19:00", "unlock_time":"20:00"},
{"enabled":false, "lock_time":"21:00", "unlock_time":"22:00"}]
would set up and enable a curfew from 7pm to 8pm and set up but disable one from 9pm to 10pm.
It is still possible to switch the currently configured curfew on and off, but the status is now called control.curfew_enabled. The curfew and last_curfew channels and their states have been removed and replaced by the aforementioned control.current_curfew and last_enabled_curfew states, both in JSON format.
The history has also been revised and is now also available in JSON format at history.json.0..x. The number of shown events can be set in the configuration (max. 25). The old history, which led to a high load for some users, can still be activated in the configuration, but is marked as deprecated and will be removed in one of the next versions. Therefore if you have scripts running that access the states of the old history, you should change them to use the new JSON states as soon as possible.
I have also refactored and tidied up a few things internally and updated the dependencies. All in all, there are quite extensive changes this time and I was only able to test the curfew with my cat flap and not with a pet flap.
So I'm looking forward to your feedback on the new features and whether everything works as it should!