Skip to content

Some javascript help, please #438

Answered by OzGav
tsx-5 asked this question in Q&A
Mar 28, 2024 · 3 comments · 6 replies
Discussion options

You must be logged in to vote

OK I think the main problem is using element.replace. I don't think element is exposed? Use entity.entity_id instead? Since you have named the element the same as the entity also change your first line to entity: fan.spare_ceiling

This worked on my test page:
console.log('entity', entity.entity_id.replace('input_number','fan'));

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@tsx-5
Comment options

Comment options

You must be logged in to vote
3 replies
@tsx-5
Comment options

@OzGav
Comment options

Answer selected by tsx-5
@tsx-5
Comment options

Comment options

You must be logged in to vote
2 replies
@tsx-5
Comment options

@exetico
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants