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

Implement encoding rules for TimeData and DateData #101

Open
Krolken opened this issue Nov 21, 2024 · 1 comment
Open

Implement encoding rules for TimeData and DateData #101

Krolken opened this issue Nov 21, 2024 · 1 comment
Assignees

Comments

@Krolken
Copy link
Contributor

Krolken commented Nov 21, 2024

There is no .to_bytes() defined for dlms_data.TimeData and `dlms_data.DateData``

They should be instanciated with either datetime, data or time object. None should also be allowed and encoded to all ones.

@define 
class TimeData:

   value: time | None = field(converter=convert_datetime_to_time)

@define
class DateData

   value: date | None = field(converters=convert_datetime_to_date)

@Krolken Krolken self-assigned this Nov 21, 2024
@Krolken
Copy link
Contributor Author

Krolken commented Nov 21, 2024

All onces b"x\ffx\ffx\ffx\ff" should also be implemented in the parsing rules.

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

No branches or pull requests

1 participant