TheTimeWalker / wallpanel-android

WallPanel is an Android application for Web Based Dashboards and Home Automation Platforms
https://wallpanel.xyz
Apache License 2.0
454 stars 45 forks source link

Update discovery configs to be compatible with Home Assistant's expectations #93

Closed antoniomika closed 1 year ago

antoniomika commented 1 year ago

In 2024, Home Assistant will stop handling names in discovered MQTT sensors as it currently does.

Currently, it strips the device name prefix from the config in order to abide by it's entity name expectations. This will be deprecated and removed in 2024. Here's the relevant post from them.

This is a simple fix and resolves the issue. I've tested this with my personal home assistant install by doing the following:

  1. Build the project and run in an emulator. I commented out the gradle plugins for google services and crashlytics, and updated my local.properties to include the required parameters for gradle (code, hassUrl, broker, brokerUsername, brokerPass).
  2. Connect it to home assistant as you would normally. Go to home assistant, restart all services (I rebooted the host through System -> Power button -> Advanced -> Reboot system. I wasn't able to get the supervisor repair system to re-run properly to show the error without doing this.
  3. Notice that the warning about the entity name change shows up
  4. Make the changes in this diff, re-run the application in the emulator
  5. Reboot Home Assistant again (as done in step 2) and notice that the errors go away

Closes #90

netlify[bot] commented 1 year ago

Deploy Preview for wallpanel canceled.

Name Link
Latest commit 31641bf3d54d697f2288f15da3688f2865162625
Latest deploy log https://app.netlify.com/sites/wallpanel/deploys/64dd8dbd184b02000783c7b9
antoniomika commented 1 year ago

Hey @TheTimeWalker,

Anything else I need to do to help get this over the line?

TheTimeWalker commented 1 year ago

Nothing to do, code-wise looks good. Will get to it asap

TheTimeWalker commented 1 year ago

Thanks again for the PR! I have used it as a base to tweak it a bit more