finity69x2 / fan-percent-button-row

Frontend plugin to control fans in Home Assistant using percent values for speeds
32 stars 19 forks source link

Incompatibility with home assistant 2023.05 beta - Custom element doesn't exist: fan-percent-button-row. #39

Closed purcell-lab closed 1 year ago

purcell-lab commented 1 year ago

Looks like some incompatibility with the new version of Home Assistant beta.

image

terryhonn commented 1 year ago

This looks to be because of https://developers.home-assistant.io/blog/2023/04/04/deprecating_polymer/

purcell-lab commented 1 year ago

Is it possible to transition this package to Lit ?

PrathikGopal commented 1 year ago

Broke mine too, it’s better to move it to lit.

19leva89 commented 1 year ago

Plugin stopped working today after update to 2023.05

mnfranca commented 1 year ago

Plugin stopped working today after update to 2023.05.

SirGoodenough commented 1 year ago

@finity69x2 has had no commits this year and only a couple in Q4 2022.

Anyone capable of taking this over, IE converting it to lit, or are we stuck with the HA vertical extra click to get there button?

Anyone found an alternative?

19leva89 commented 1 year ago

Yesterday install https://github.com/piitaya/lovelace-mushroom/blob/main/docs/cards/fan.md

shmuelzon commented 1 year ago

Hey all,

I've done the bare minimum to migrate this plugin from Polymer to Lit, you can find it at: https://github.com/shmuelzon/fan-percent-button-row Right now it pulls Lit from the Internet, which I don't really like. Apparently, the proper way to do it is to package Lit inside the custom row JS but, as I have no idea what I'm doing, it will take a bit more time to get it right.

Let me know, on my fork, if something's not working for you.

And many thanks to @finity69x2 for creating it in the first place! If you're still maintaining this repository, please let me know and I'll create a pull request with the changes.

hansmets commented 1 year ago

Right now it pulls Lit from the Internet, which I don't really like. Apparently, the proper way to do it is to package Lit inside the custom row JS but, as I have no idea what I'm doing, it will take a bit more time to get it right.

I think it is enough to add import { LitElement, html, css, } from 'lit';

At least the example from Homeassistant at https://github.com/custom-cards/boilerplate-card does it in this way.

shmuelzon commented 1 year ago

I think it is enough to add import { LitElement, html, css, } from 'lit';

At least the example from Homeassistant at https://github.com/custom-cards/boilerplate-card does it in this way.

I tried that first, but it didn't work. The way that project works is that there's an extra step of packaging everything. They add a dependency on Lit, pull it via NPM, and package their sources and dependencies to a single file with Rollup. I've already done that on my fork and it seems to work fine. I'll push it later on

ThirteenTX commented 1 year ago

So I don't see where I can open an issue or comment on your fork. I tried copying the file and replacing the file from HACS but it still fails. Not sure what else to try there.

shmuelzon commented 1 year ago

Right, sorry. I enabled issues on my fork. Anyway, you should be able to take https://raw.githubusercontent.com/shmuelzon/fan-percent-button-row/main/fan-percent-button-row.js as is and replace the existing one. Make sure you refresh your browser and/or clear the cache.

hansmets commented 1 year ago

Right, sorry. I enabled issues on my fork. Anyway, you should be able to take https://raw.githubusercontent.com/shmuelzon/fan-percent-button-row/main/fan-percent-button-row.js as is and replace the existing one. Make sure you refresh your browser and/or clear the cache.

I actualy added shmuelzon/fan-percent-button-row in HACS as a custom repository and installed it directly from HACS (I first removed the old polymer version). It then even shows the updates and clears the cache for you.

mihatsu commented 1 year ago

thanks for fixing this, works as old times!

EvanGrote commented 1 year ago

fan-percent-button-row is dead, long live fan-percent-button-row!

ronjtaylor commented 1 year ago

I used hansmets suggestion and it worked. However the option to reverseButtons does not work. Not a big thing but it's the way I had it working for my family.

finity69x2 commented 1 year ago

And many thanks to @finity69x2 for creating it in the first place! If you're still maintaining this repository, please let me know and I'll create a pull request with the changes.

absolutely... thank you.

I haven't had any activity on this because...well...it just worked :)

I've been trying to figure this out for the last few weeks and my real life has been ridiculously busy so I haven't had much luck. And unfortunately I haven't had much time to even think about looking here at the issues yet.

If you don't mind I'll look at your repo and see if I can get this working again.

finity69x2 commented 1 year ago

fan-percent-button-row is dead, long live fan-percent-button-row!

Hopefully not! :)

now that I have an example to go on.

shmuelzon commented 1 year ago

I used hansmets suggestion and it worked. However the option to reverseButtons does not work. Not a big thing but it's the way I had it working for my family.

In my case, I saw that the reverseButtons option did work, but was the opposite of what I had set, i.e., I needed to set it to false to get the same results with what I had with the previous version. Maybe the default changed at some point as the version I had was very old?

shmuelzon commented 1 year ago

If you don't mind I'll look at your repo and see if I can get this working again.

Sure thing, let me know if there's anything I can help with

ben-ty commented 1 year ago

Hi,

Please find attached my own version migrated to lit. If you can review and update your base code it will be great :)

Regards,

Benoît

fan-percent-button-row.js.zip

blhoward2 commented 1 year ago

Hi,

Please find attached my own version migrated to lit. If you can review and update your base code it will be great :)

Regards,

Benoît

fan-percent-button-row.js.zip

I confirm this works. Why don't you actually open a PR to merge in the changes, though? There may be a better shot the maintainer does it quickly if he can just click merge...

Let me know if you need help and I'll PR in your changes.

ben-ty commented 1 year ago

Hi, Please find attached my own version migrated to lit. If you can review and update your base code it will be great :) Regards, Benoît fan-percent-button-row.js.zip

I confirm this works. Why don't you actually open a PR to merge in the changes, though? There may be a better shot the maintainer does it quickly if he can just click merge...

Let me know if you need help and I'll PR in your changes.

You are right, PR submitted.

finity69x2 commented 1 year ago

Thank you @ben-ty.

I've merged the PR.

I'll be able to use yours as a template to update my others now.

Thank you again very much.

PrathikGopal commented 1 year ago

Just updated to v3.0 working as expected 👍🏽, thanks for fixing it @ben-ty @finity69x2

jumblies commented 1 year ago

Confirmed x2 - Quick upgrade in HACS and back in action. Thanks @finity69x2 @ben-ty

finity69x2 commented 1 year ago

Should be fixed now.