Fix WUnderground names#12346
Conversation
|
So I just went looking a bit at recent code changes to figure out how |
|
I changed that logic here: https://github.com/home-assistant/home-assistant/pull/12237/files#diff-2f6e7e067d836cc94edba0d7d51d0241L227 . We should always have just looked at |
| self._entity_picture = None | ||
| self._unit_of_measurement = self._cfg_expand("unit_of_measurement") | ||
| self.rest.request_feature(SENSOR_TYPES[condition].feature) | ||
| self.entity_id = async_generate_entity_id( |
There was a problem hiding this comment.
You are not allowed to call async functions from a sync context.
This is not executed in an async context (because it's setup_platform instead of async_setup_platform).
|
@rpitera Works for me :/ (Yes it's quite cold here in Austria 😄) Question: Are you sure you've manually patched this into your install? Because this PR isn't in Home Assistant yet - though it will be in 0.63.2 |
|
I checked my perms and they are correct; do I have new
I just restarted and cleared the cache again but still seeing the same thing. Only on the forecast sensors, everything else is fine. |
* 📝 Fix WUnderground names * 👻 Fix using event loop callback
|
So just to follow up, 0.63.2 did fix the problem for me; I removed the test code prior to update and restart. But I am still confused as to why the test code didn't work or whether I had it in the wrong location. |
|
@rpitera It should be just |
|
Thanks! It's been awhile since I tested anything and I forgot. |


Description:
With the changes made for the entity registry, WUnderground's (horrible) way of reporting friendly names to Home Assistant's core broke. Before, each WUnderground sensor would set the friendly name by setting the
ATTR_FRIENDLY_NAMEattribute on the sensor and the entity_id would be reported through thenameproperty. This no longer works with the following code that creates theentity_idfor each entity and no longer takes into accountattributes[ATTR_FRIENDLY_NAME]:https://github.com/home-assistant/home-assistant/blob/034eb9ae1aa33cec829393f409343919c036044c/homeassistant/helpers/entity_platform.py#L230-L233
This PR simply makes WUnderground use the
nameproperty for the friendly name and theentity_idattribute to set the entity_id.Before:
After:
Related issue (if applicable): fixes #12282
Example entry for
configuration.yaml(if applicable):Checklist:
toxrun successfully. Your PR cannot be merged unless tests pass