Skip to content

refactor: set device properties only if all checks are good#327

Closed
IvoGruber wants to merge 2 commits intoBluetooth-Devices:mainfrom
IvoGruber:set-device-properties-only-if-all-checks-are-good
Closed

refactor: set device properties only if all checks are good#327
IvoGruber wants to merge 2 commits intoBluetooth-Devices:mainfrom
IvoGruber:set-device-properties-only-if-all-checks-are-good

Conversation

@IvoGruber
Copy link
Contributor

@IvoGruber IvoGruber commented Dec 30, 2025

This is for discussion first. In encrypted mode you do not want to set any properties prior checking that every check is good to prevent attackers from doing stuff here.
That is why I moved down setting some of them based on meta data, not payload. But this breaks some tests. If you agree I would investigate why tests are failing and continue on fixing them.

@Ernst79
Copy link
Collaborator

Ernst79 commented Dec 30, 2025

Wouldn’t we need some device info in HA before we enter the encryption key? Not entirely sure if this is needed in HA.

@IvoGruber
Copy link
Contributor Author

Wouldn’t we need some device info in HA before we enter the encryption key? Not entirely sure if this is needed in HA.

Will check the tests first. Maybe that gives me some hints. But probably will not happen the next days.

@Ernst79
Copy link
Collaborator

Ernst79 commented Dec 30, 2025

Sure, no problem. You did more than enough last week :-) much appreciated.

@IvoGruber
Copy link
Contributor Author

Wouldn’t we need some device info in HA before we enter the encryption key? Not entirely sure if this is needed in HA.

Tests fail, because they expect the call to "supported" returns true. "supported" checks if a device type is set int the base class. I currently would argue that a device that sends corrupted data should not be supported and override that method accordingly, but I am not sure. Should investigate the integration code in HA first. We anyway still need to support devices that send encrypted data but encryption failed cause bind key is not set. So you are true on that.

@IvoGruber
Copy link
Contributor Author

I close this for now, needs more investigation on how things work in HA first and will have a later try on this when that device properties stuff in refactored.

@IvoGruber IvoGruber closed this Jan 3, 2026
@IvoGruber IvoGruber deleted the set-device-properties-only-if-all-checks-are-good branch January 3, 2026 14:30
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

Comments