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

Add parsing of product data #9

Merged
merged 13 commits into from
Sep 15, 2022
Merged

Add parsing of product data #9

merged 13 commits into from
Sep 15, 2022

Conversation

elupus
Copy link
Collaborator

@elupus elupus commented Sep 10, 2022

No description provided.

@elupus
Copy link
Collaborator Author

elupus commented Sep 10, 2022

I think it's a greedy string. nibepi does some weird things with the first byte + 5 or similar to get the length. https://github.com/anerdins/nibepi/blob/080db44d7ecca82b5c75bd7defd2f078687ab877/index.js#L383

@yozik04 yozik04 added this to the 0.5.0 milestone Sep 10, 2022
@yozik04
Copy link
Owner

yozik04 commented Sep 10, 2022

I agree that nibepi does some weird stuff... GreedyString seems to be right.
Is this PR ready? I am ready to merge.

@yozik04
Copy link
Owner

yozik04 commented Sep 10, 2022

@elupus
Copy link
Collaborator Author

elupus commented Sep 10, 2022

Yes probably. Any thoughts on how it should be exposed? I think it could be sent to other addresses than MODBUS40

@yozik04
Copy link
Owner

yozik04 commented Sep 10, 2022 via email

@elupus
Copy link
Collaborator Author

elupus commented Sep 10, 2022

Sounds good.

Ps. Initial native home assistant implementation: https://github.com/home-assistant/core/compare/dev...elupus:home-assistant:nibe/local?expand=1

Just plain sensors for now. Will look at the other fun stuff later.

@yozik04
Copy link
Owner

yozik04 commented Sep 10, 2022

Take a look. I am not confident in read_product method name and Product dataclass name. Need to think about it.

@elupus
Copy link
Collaborator Author

elupus commented Sep 10, 2022

I think we should cache the product data. It seems its only sent quite infrequently. Since we cant trigger it to be sent, it feel like a cache of last received data might be in order?

@yozik04
Copy link
Owner

yozik04 commented Sep 10, 2022

It is sent every 15 seconds. I'd wait for this message as part of initial connection process. The response can be cached, yes.

nibe/connection/nibegw.py Outdated Show resolved Hide resolved
@yozik04
Copy link
Owner

yozik04 commented Sep 11, 2022

I think this can be merged already.

Copy link
Collaborator Author

@elupus elupus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@yozik04 yozik04 merged commit 4d4676b into yozik04:master Sep 15, 2022
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.

2 participants