Closed wgstarks closed 3 months ago
Fix the posted code, it is unformatted. And do not post it as a picture.
Fix the posted code, it is unformatted. And do not post it as a picture.
Not sure how to post the yaml and preserve formatting? If I attempt to edit it it appears with the proper formatting.
Ok got it.
type: custom:restriction-card
row: true
card:
entity: switch.greenhouse_lights_switch
restrictions:
confirm:
text: Are you sure you want to turn the lights on/off?
The "row" card is supposed to be used in Entities card. Is it what you do?
Yes. Here is the entire card-
type: entities
entities:
- entity: sensor.greenhouse_temperature_humidity_greenhouse_temperature
- entity: sensor.greenhouse_temperature_humidity_greenhouse_humidity
- type: custom:restriction-card
row: true
card:
entity: switch.greenhouse_lights_switch
restrictions:
confirm:
text: Are you sure you want to turn the lights on/off?
- type: custom:restriction-card
row: true
card:
entity: switch.greenhouse_heater_greenhouse_heater
restrictions:
confirm:
text: Are you sure you want to turn the heater on/off?
- entity: binary_sensor.front_door_1_front_door_1
- entity: binary_sensor.front_door_2_front_door_2
- entity: switch.greenhouse_lights_switch
name: Greenhouse Lights
secondary_info: entity-id
icon: mdi:lightbulb
- entity: switch.greenhouse_heater_greenhouse_heater
secondary_info: entity-id
And what do you mean by "not working"? It was not described in your post.
Besides, those "checkboxes" which you missed were with some meaning.
It has stopped changing the state of the switch. If I click the switch I get the confirmation popup, select ok and then the state of the switch remains unchanged. This card was working properly until the most recent update to home assistant.
The restriction-card
DOES NOT change states of entities.
The card merely intercepts a mouse events when in a "locked" state.
In your particular case: after pressing OK in a confirmation dialog you may do whatever you want - either tap on a row or toggle a switch.
Thanks. In my original testing a single click was all that was needed but it appears that was improper operation and whatever the problem was is now corrected.
Again, thanks for the support.
Good that you sorted it out. Here is a discussion of this card: https://community.home-assistant.io/t/lovelace-restriction-card-client-side-security/142889 Please ask all card-related questions there.
Checklist:
Release with the issue:
1.2.9
Last working release (if known):
Browser and Operating System:
MacOS Safari, Firefox, Chrome, HA app
Description of problem:
Javascript errors shown in the web inspector (if applicable):
Additional information:
I'm not seeing anything in the logs.
Sample YAML configuration-
type: custom:restriction-card row: true card: entity: switch.greenhouse_lights_switch restrictions: confirm: text: Are you sure you want to turn the lights on/off?