vlebourl / custom_vesync

Custom VeSync component for Home Assistant
98 stars 75 forks source link

Change device info "default_manufacturer" to "manufacturer" - Fix for HA 2023.8 #154

Closed RobertD502 closed 1 year ago

RobertD502 commented 1 year ago

Currently running the beta for Home Assistant 2023.8. It looks like they have introduced a validator in the device registry that now checks the validity of an entity's device info.

Starting with 2023.8, the following error is logged for all entities:

Logger: homeassistant.components.number
Source: helpers/entity_platform.py:624
Integration: Number (documentation, issues)
First occurred: 7:06:46 PM (2 occurrences)
Last logged: 7:06:46 PM

Ignoring invalid device info: Invalid device info {'default_manufacturer': 'VeSync', 'identifiers': {('vesync', 'vsaqf650392470db518f6893d5e0f296')}, 'model': 'Classic300S', 'name': 'Bedroom Humidifier', 'sw_version': None} for 'vesync' config entry: device info needs to either describe a device, link to existing device or provide extra information.

The default_manufacturer key is part of secondary device info while the rest of the device info that you have is primary. This mix between primary and secondary info causes a DeviceInfoError exception to be raised.

Changing the key to manufacturer instead makes Home Assistant happy as now all parts of the device info provided are primary.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

mkennel commented 1 year ago

Please approve this pull request, This fixes an issue on my instance where devices stop working and when readded they are added as entities only.

vlebourl commented 1 year ago

Thanks a lot!