Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enocean plugin]: Introduce Protocol Module and Load CRC and CONSTANTS from Module #893

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

hasenradball
Copy link
Contributor

@hasenradball hasenradball commented Jan 11, 2024

Introduce Protocol Module

  • add submodule constants
  • add submodule crc8

remove CRC table from init.py and load it from module

  • clean up init.py
  • use static_method from module

remove Constants definition from __init__.py

  • remove constants from main file
  • add loading constants as required from constants module

Reason for Change

  • set a basis for future code and structure improvements
  • increase maintainability
  • increase readability of __init__.py

Status

  • tested
  • no functional change actually
  • is a basis for future improvements

@hasenradball
Copy link
Contributor Author

hasenradball commented Jan 11, 2024

@Morg42
Hi,
hier mal ein kleines Beispiel wir ich CONSTANTEN auslagern würde.
Erst mal nur am Beispiel der CRC Table.

PS: und natürlich vorher gestestet, läuft.

@hasenradball hasenradball changed the title introduce prtotocol module and load CRC from module [enocean plugin]: Introduce prtotocol module and load CRC from module Jan 11, 2024
@Morg42
Copy link
Member

Morg42 commented Jan 11, 2024

Wieso braucht es für CRC überhaupt eine Tabelle? Und schau dir mal @staticmethod an...

@hasenradball
Copy link
Contributor Author

hasenradball commented Jan 11, 2024

@Morg42
Ich verstehe Deine Frage nicht ganz.
Was wolltest Du sagen?

@staticmethod als decorator kenne ich, ja kann man auch so nutzen.

Aber was passt Dir an der Tabelle nicht?
sieh mal hier Seite 111

@hasenradball hasenradball changed the title [enocean plugin]: Introduce prtotocol module and load CRC from module [enocean plugin]: Introduce protocol module and load CRC from module Jan 11, 2024
@Morg42
Copy link
Member

Morg42 commented Jan 11, 2024

Aus prinzipiellen und ästhetischen Gründen "passt" mir nicht, riesige Tabellen mitzuschleppen, die man "mal eben" auch automatisch befüllen lassen kann ;)

Und ja, ich kenne den Standard :)

@hasenradball
Copy link
Contributor Author

hasenradball commented Jan 11, 2024

Was wäre dein alternativ Vorschlag?
Wie würdest Du die Tabelle generieren?

Klar gebe Dir recht schön ist sie nicht, aber man kann so immer nachvollziehen wie man zu den Werten kommt.
Wenn Du die nicht mitschleppst musst halt dazuschreiben wie diese gerneriert wird.

Aber das mit der Tabelle sehe ich erstmal als kleine Baustelle an. :-)

@hasenradball hasenradball changed the title [enocean plugin]: Introduce protocol module and load CRC from module [enocean plugin]: Introduce Protocol Module and Load CRC and CONSTANTS from Module Jan 12, 2024
@aschwith aschwith added this to the Version 1.11 milestone Jan 13, 2024
@hasenradball
Copy link
Contributor Author

hasenradball commented Jan 13, 2024

:-)

@hasenradball
Copy link
Contributor Author

Constant optimisation is working and PR is ready to merge!

@Morg42
Copy link
Member

Morg42 commented Feb 29, 2024

Mach doch erstmal weiter, bis ein wirklicher Fortschritt erreicht ist.

@hasenradball
Copy link
Contributor Author

@Morg42 werde ich auch tun, allerdings kann ich nicht so regelmäßig dran arbeiten, daher step1.
Ein Schritt nach dem anderen…
😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants