al-one / hass-xiaomi-miot

Automatic integrate all Xiaomi devices to HomeAssistant via miot-spec, support Wi-Fi, BLE, ZigBee devices. 小米米家智能家居设备接入Hass集成
https://miot-spec.com
Apache License 2.0
4.42k stars 616 forks source link

Implementation of icon support for fan presets #1796

Open il77781 opened 1 month ago

il77781 commented 1 month ago

Hello. In the 2024.2 Home Assistant update, it is indicated that it is now possible to assign custom icons, for example, for fan presets. It is written about it here: https://www.home-assistant.io/blog/2024/02/07/release-20242/#icons-everywhere It says that integrations can now provide icons for things like fan speeds or thermostat presets As far as I understand, it should be implemented like this: https://developers.home-assistant.io/docs/core/entity/#icons And, as far as I understand, it should be implemented by the developer of a particular integration... At the moment, when using this integration for Xiaomi Mijia Smart Evaporative Cooling Fan (dmaker_p44), icons for fan presets are not displayed on the standard HA card for fans (as well as icons for fan speeds). Perhaps this is because the standard names of the presets and fan speeds "sewn" into the HA do not match those assigned in this integration for my particular fan... It's a pretty sad story - everything looks very uninformative... Accordingly, in this situation it would be very appropriate to take advantage of the new features that have been implemented since version 2024.2 ... But for this it must be implemented by the developer of this integration! If this has already been implemented, please tell me how to use it. But if it has not been implemented yet, please do it! I think it would be useful for many users of this integration!

jeroenvdd commented 3 weeks ago

To add to this: it would also be nice to not only add this option for developers but also people who have defined a fan trough a fan template

il77781 commented 3 weeks ago

@jeroenvdd, as far as I understood what is written by the links I provided, the integration developer (in this case - @al-one) must add support for such "translations" to the integration code itself, and then the file with the "translation" can already be adjusted by the end user of the integration, by adjusting its contents to his specific device... And in this case, as far as I understand, it will work when setting up the fun template: you can specify the names of presets that this integration gives out... And for these names of presets, the file with the "translation" will contain links to icons - and fun template will already use them... Do you have a different opinion? Maybe I'm misunderstanding something... It only remains to add that, quite possibly, we will have to wait a very long tme for the necessary modification of integration... @al-one is not very willing to respond to anything that is not written in Chinese... In the meantime, I'm solving the problem of correctly displaying everything I need with this thing: https://github.com/custom-cards/button-card It is, of course, much more functional than the fun template...