rodrigofragadf / lovelace-cards

Cards for Lovelace
MIT License
31 stars 12 forks source link

Cannot assign to read only property 'id' of object '#<Object>' #10

Open antoinevandenhurk opened 4 years ago

antoinevandenhurk commented 4 years ago

Since release HA release 0.106.1 has an error occurred (Cannot assign to read only property 'id' of object '#') in my lovelace configuration. I have used the config of Tom with de tiles-card script. Is a new version of tiles-card.js coming?

resources:

  • type: js url: /local/tiles-card.js?v=0.1

https://community.home-assistant.io/t/kodi-remote/97652/19?u=antoinevandenhurk

Flavien commented 4 years ago

Same problem here.

tomlut commented 4 years ago

This is likely due to the following change in 0.106:

Custom cards

Are you the creator of an awesome custom card for Lovelace?

We have made some changes to Lovelace that might impact your custom card, so be sure to read the blog post 21 on the developers site about this.

Blog post link: https://developers.home-assistant.io/blog/2020/02/18/106-custom-card-changes.html

The last time this card was maintained was 15 months ago. It may be abandoned. 😬

I hope not. I find it very useful and a lot more intuitive to use than the custom button card and have made extensive use of it.

Spirituss commented 4 years ago

Same problem is here. Very convenient card, hope the correction will be done asap.

tomlut commented 4 years ago

Pretty sure this card is abandoned, button-card is the closest (complicated) replacement.

gtivr4 commented 4 years ago

Please Help, I have extensive use of TILES.

image

Spirituss commented 4 years ago

Pretty sure this card is abandoned, button-card is the closest (complicated) replacement.

Unfortunately, button-card can't work with different vertical entity sizes and common grid for the group of entities. Other features can be substituted by custom-card.

tomlut commented 4 years ago

Time to face facts folks. This card is dead.

Possible replacements:

Full featured and complicated: https://github.com/custom-cards/button-card

A less complicated but less feature rich version: https://github.com/custom-cards/button-entity-row

chipriley commented 4 years ago

Using some of the information that @thomasloven wrote up about the config changes in 0.106, I added one line of code to this card and it works like a champ. Right after line 15, which is the first line in the codeblock below, add the config = JSON.parse(JSON.stringify(config));

setConfig(config) {

    config = JSON.parse(JSON.stringify(config));

    if(!config.entities) {
        throw new Error('Please define your entities');
    }

Note: pls disregard the other committed files in the above-linked commit as I committed an update to HACS at the same time. I'll also try and find the info @thomasloven wrote up where I got that line of code and link to it.

chipriley commented 4 years ago

Here's the essential part of where I got the code from @thomasloven. All credit goes to him for my band-aid fix.

tomlut commented 4 years ago

Awesome! Thanks for the fix. It certainly gives me time to consider if I should continue to use this card.

tomlut commented 4 years ago

Unfortunately this did not fix it for me. It's still failing to display. Now with "Attempted to assign to readonly property".

EDIT: strangely this only appears to be an issue with the IOS app. Firefox is fine.

EDIT2: Resetting the app's frontend cache did not fix it but pulling down on the display to refresh did. Very odd.

Either way this unsupported app is only going to get flakier. This weekend's task will be to rid myself of it.

tomlut commented 4 years ago

You guys should really change over to the custom button card. I have exactly what I did before (and even some nice enhancements, like more info pop-up on hold) except using literally hundreds less lines of Lovelace code.