custom-cards / light-entity-row

Entity row for lights with sliders for adjusting different values based on features
55 stars 13 forks source link

Not working since today's Hass update to 106 #12

Closed tom-lejeune closed 3 years ago

tom-lejeune commented 4 years ago

Cannot assign to read only property 'buttons' of object '#' buttons: [] entity: light.spotjes icon: 'mdi:lightbulb-outline' name: spotjes type: 'custom:light-entity-row'

Screenshot_20200227-001352

michelcve commented 4 years ago

I can confirm this is broken

flamingm0e commented 4 years ago

Thought this was just me. She's definitely broken. :crying_cat_face:

michelcve commented 4 years ago

It's fairly easy to fix yourself, just replace the setConfig function with this:

  setConfig(config)
  {

    const checkServiceRegexp = /^(light|group)\./
    if (!checkServiceRegexp.test(config.entity)) {
      throw new Error(`invalid entity ${config.entity}`)
    }

    this._config = {...config, buttons: config.buttons ? [...config.buttons] : []};

  }
LEJOUI commented 4 years ago

This solution does work in the standard HA theme, but not in a custom theme like IOS dark mode. Any suggestions?

edit: It doesn't work in the default theme.

LEJOUI commented 4 years ago

So I uninstalled and deleted this repo in HACS and installed this fork: https://github.com/maur8ino/light-entity-row

It actually has another change in the code:

  setConfig(config)
  {

    const checkServiceRegexp = /^(light|group)\./
    if (!checkServiceRegexp.test(config.entity)) {
      throw new Error(`invalid entity ${config.entity}`)
    }

    this._config = JSON.parse(JSON.stringify(config));
    this._config.buttons = config.buttons || []

  }

I only got it to work by deleting this repo and not manually edit it.

vakilando commented 4 years ago

I did the same as mentioned for the custom-card "button-entity-row". I added "config = JSON.parse(JSON.stringify(config))" at line 163 like this:

setConfig(config)
{
  config = JSON.parse(JSON.stringify(config))
  const checkServiceRegexp = /^light\./
  if (!checkServiceRegexp.test(config.entity)) {
    throw new Error(`invalid entity ${config.entity}`)
  }
  this._config = config;
  this._config.buttons = config.buttons || []

This works fine, even with a custom theme (slate, ios)

AngelofromTurin commented 4 years ago

hi! don't work for me any of thise editing, i try to disistall and install the Mayr8ino' s fork; i can see the button but don't work and i cant hide the temperature's line too

vakilando commented 4 years ago

sadly broken again with HA 0.108.6...............couldn't get it to work again this time.......

vakilando commented 4 years ago

@LEJOUI great! Me too I uninstalled and deleted this repo in HACS and installed this fork: https://github.com/maur8ino/light-entity-row. It's working again now.

opep commented 4 years ago

https://github.com/maur8ino/light-entity-row.

Can someone confirm that it is still working with HA 0.110.2? I have never used this custom card, but I am receiving this error... Thanks. image

LEJOUI commented 4 years ago

It does work. Delete this repo in HACS and use the fork of Maur8ino

AngelofromTurin commented 4 years ago

It does work. Delete this repo in HACS and use the fork of Maur8ino

Hi , sorry what the link please ? :)

opep commented 4 years ago

It does work. Delete this repo in HACS and use the fork of Maur8ino

Hi , sorry what the link please ? :)

https://github.com/maur8ino/light-entity-row.

opep commented 4 years ago

It does work. Delete this repo in HACS and use the fork of Maur8ino

Got it to work! Thanks!

AngelofromTurin commented 4 years ago

Thank you ! I just try thise but dont work for me the button cant touchable and dont work

LEJOUI commented 4 years ago

Thank you ! I just try thise but dont work for me the button cant touchable and dont work

Do you see any errors in your log? Could you post your config for the card? How did you install it? Is the card added in the lovelace resources?

AngelofromTurin commented 4 years ago

Thank you ! I just try thise but dont work for me the button cant touchable and dont work

Do you see any errors in your log? Could you post your config for the card? How did you install it? Is the card added in the lovelace resources?

the card was added to lovelace's resources thise the error : http://192.168.188.191:8123/hacsfiles/light-entity-row/light-entity-row.js:321:35 Uncaught TypeError: Cannot add property entity_id, object is not extensible and thise my card's configuration:

`entities:

  • buttons:
    • name: Rosso service_data: color_name: red
    • name: Blue service_data: color_name: blue
    • name: Verde service_data: color_name: green
    • name: Fucsia service_data: rgb_color:
      • 255
      • 6
      • 16
    • name: 'Off' service_data: effect: 'Off' entity: light.shelly_shrgbw2_6613fd hideBrightness: true hideColorTemp: true hideTempButtons: true type: 'custom:light-entity-row' show_header_toggle: false title: 'prova: custom:light-entity-row' type: entities`
opep commented 4 years ago

thise the error : http://192.168.188.191:8123/hacsfiles/light-entity-row/light-entity-row.js:321:35 Uncaught TypeError:

You should uninstall from HACS. Reference to something like: /local/community/light-entity-row

AngelofromTurin commented 4 years ago

thise the error : http://192.168.188.191:8123/hacsfiles/light-entity-row/light-entity-row.js:321:35 Uncaught TypeError:

You should uninstall from HACS. Reference to something like: /local/community/light-entity-row

i unistall and install many time but not change...

i dont have error but the button: "red blue fucsia off" wasnt button just text...

LEJOUI commented 4 years ago

Just to be sure, you did uninstall this and install the fork from Mauri8no? Did you try to clear the cache?

I do assume that the spacing of your card config is ok?

AngelofromTurin commented 4 years ago

DCCFCD4B-89C1-45C7-951E-8E85580F7ECF yes im sure , the spacing is ok :)

LEJOUI commented 4 years ago

I was able to reproduce your issue. Custom buttons don't work with this solution. I forked it and found a solution what works here. Could you give it a try? https://github.com/LEJOUI/light-entity-row

LEJOUI commented 4 years ago

Hmm. I'm still finding some issues with other components in my fork. Will let you know if I find something else

AngelofromTurin commented 4 years ago

I was able to reproduce your issue. Custom buttons don't work with this solution. I forked it and found a solution what works here. Could you give it a try? https://github.com/LEJOUI/light-entity-row

Woow Now work ! thank you ! the only one issue is thise: the button work, but, the mouse on button not change image from arrow to hand (like usual link)

LEJOUI commented 4 years ago

Yeah, this was already the case I thought. Might look in that later. Fork should now do the tric for this. I found that buttons: [] is required to make it actually work, even if you don't want to have custom buttons. Not a real coder/programmer here.

AngelofromTurin commented 4 years ago

well, i add youre repo on my hacs :) now i follow easily your work :)

jacekpaszkowski commented 3 years ago

same issue here Cannot add property buttons, object is not extensible.

But when i use this row inside declutering-card it works ok:

decluttering_templates:
  bedroom_lights:
    card:
      entities:
        - entity: light.bedroom_leds
          showColorPicker: false
          type: 'custom:light-entity-row'
        - entity: light.yeelight_bedside_286c0786a55b
          showColorPicker: false
          type: 'custom:light-entity-row'
      show_header_toggle: false
      title: '[[title]]'
      type: entities