smarthomeNG / plugins

Plugins for SmartHomeNG - The device integration platform for your smart home
https://www.smarthomeNG.de
45 stars 99 forks source link

enocean: modify connect logics, include refactoring by hasenradball #944

Closed Morg42 closed 3 months ago

Morg42 commented 3 months ago

Should be able to handle disconnects/removal of EnOcean device and recovery if found again. Configurable retry and retry_cycle parameters.

Modified main run() loop to try reconnecting,

Refactored, fixed and cleaned up

included refactoring by hasenradball (move CRC and constants to protocol submodule)

hasenradball commented 3 months ago

@Morg42, ah ich sehe gerade Du hast meine Sachen übernommen ( Kommentar). Danke, bin gerade etwas außer gefecht gesetzt mit nur einem Arm programmiert es sich nicht so gut..

hasenradball commented 3 months ago

@Morg42 Hi, kurze Frage, warum hast du die CRC Table nicht in die Constants gepackt? Ist doch auch eine Art Konstante, oder?

Morg42 commented 3 months ago

Weil das Werte sind, die ausschließlich lokal verwendet werden und auch keine ggf zu ändernden Parameter sind. Würde constants.py nur unübersichtlicher machen

hasenradball commented 3 months ago

Weil das Werte sind, die ausschließlich lokal verwendet werden und auch keine ggf zu ändernden Parameter sind. Würde constants.py nur unübersichtlicher machen

Ok passt, hab auch gesehen Du hast eine call methode eingebaut. 👍

Morg42 commented 3 months ago

@hasenradball Hast du mal testen können, ob das bei dir alles funktioniert? Nicht, dass irgendwas "nebenher" kaputt gegangen ist? Ich habe nur Fenstergriffe, kann insofern keine sonstigen Geräte testen...

hasenradball commented 3 months ago

@Morg42 Hi, hi konnte leider noch nicht testen. wie heißt der branch enocean, richtig?

hasenradball commented 3 months ago

@Morg42 helf mir mal bitte kurz auf die Sprünge, kann ich dein branch bei mir direkt auschecken? Oder muss ich dazu dein Repo in plugins clonen?

Morg42 commented 3 months ago

Auschecken? Nein, nur, wenn du erst mein Repo gecloned hast:

git checkout -b enocean https://github.com/Morg42/plugins.git

Danach das Plugin aus meinem Repo in dein Arbeitsverzeichnis kopieren...

Ansonsten gab es dazu im Forum mal eine Anleitung...

bmxp commented 3 months ago

Ansonsten gab es dazu im Forum mal eine Anleitung...

Siehe https://knx-user-forum.de/forum/supportforen/smarthome-py/1695551-privates-plugin-zum-testen-ins-eigene-repo-herunterladen

hasenradball commented 3 months ago

@Morg42 @bmxp

Danke habs mittels eines zweiten remote hinbekommen.

origin  https://github.com/smarthomeNG/plugins.git (fetch)
origin  https://github.com/smarthomeNG/plugins.git (push)
test    https://github.com/Morg42/plugins.git (fetch)
test    https://github.com/Morg42/plugins.git (push)
(py_shng) smarthome@pi-smarthome2:/usr/local/smarthome/plugins $ git status
HEAD losgelöst bei test/enocean
nichts zu committen, Arbeitsverzeichnis unverändert
(py_shng) smarthome@pi-smarthome2:/usr/local/smarthome/plugins $

Also ich habe den enocean branch gerade reingezogen beim reboot hatte ich nur beim AVM plugin einige errors, aber enochean lief ohne Auffälligkeiten.

Ich würde vorschlagen den enocen branch mal in den develop zu mergen und ich lass das enocean mal einige Wochen im produktiv System laufen.

Sieht gut aus.

hasenradball commented 3 months ago

@Morg42 dann kann ich mein usprünglichen branch ja löschen, korrekt?

hasenradball commented 3 months ago

@Morg42 @bmxp Habe nun das Produktivsystem auf develop umgestellt. Keine Fehler von enocean.

Sagt euch das etwas:

04:06 NOTICE   lib.smarthome       --------------------   Init SmartHomeNG v1.10.0-master (4b25822a0)   --------------------
2024-07-02  18:04:06 NOTICE   lib.smarthome       Running in Python interpreter 'v3.11.2 final' in virtual environment, from directory /usr/local/smarthome
2024-07-02  18:04:06 NOTICE   lib.smarthome        - operating system 'Debian GNU/Linux 12 (bookworm)' (pid=167179)
2024-07-02  18:04:06 NOTICE   lib.smarthome        - on 'Raspberry Pi 3 Model B v1.2, 1GB (Sony, UK)'
2024-07-02  18:04:10 NOTICE   lib.smarthome        - Nutze Feiertage für Land 'DE', Provinz 'None', 1 benutzerdefinierte(r) Feiertag(e) definiert
2024-07-02  18:04:36 NOTICE   lib.smarthome       --------------------   SmartHomeNG initialization finished   --------------------
2024-07-02  18:04:36 WARNING  lib.item.item       Item 'EG.Wohnen.FritzDect.uzsu.next.value': problem evaluating 'sh.EG.Wohnen.FritzDect.uzsu.next.property.value['value']' - KeyError (in dict)
2024-07-02  18:04:36 WARNING  lib.item.item       Item 'EG.Wohnen.FritzDect.uzsu.next.time': problem evaluating 'sh.EG.Wohnen.FritzDect.uzsu.next.property.value['next']' - KeyError (in dict)
2024-07-02  18:04:36 WARNING  lib.item.item       Item 'OG.Flur.RollladenZentral.Lauf.uzsu.next.value': problem evaluating 'sh.OG.Flur.RollladenZentral.Lauf.uzsu.next.property.value['value']' - KeyError (in dict)
2024-07-02  18:04:36 WARNING  lib.item.item       Item 'OG.Flur.RollladenZentral.Lauf.uzsu.next.time': problem evaluating 'sh.OG.Flur.RollladenZentral.Lauf.uzsu.next.property.value['next']' - KeyError (in dict)
2024-07-02  18:04:36 WARNING  lib.item.item       Item 'UG.Technik.WW_Pumpe.uzsu.next.value': problem evaluating 'sh.UG.Technik.WW_Pumpe.uzsu.next.property.value['value']' - KeyError (in dict)
2024-07-02  18:04:36 WARNING  lib.item.item       Item 'UG.Technik.WW_Pumpe.uzsu.next.time': problem evaluating 'sh.UG.Technik.WW_Pumpe.uzsu.next.property.value['next']' - KeyError (in dict)