Closed franksimoes closed 4 years ago
What does that mean? Does it show nothing? Does it show the user view for both users? Does it show the admin view for both users? Does it show the opposite view? Does it show something completely different?
Sorry I think I was very direct and succinct.
What does that mean? I have an âadministratorâ user (george) and another âuserâ (teste), and Iâd like to show âxxx_adm_setup_list.yamlâ for the âuserâ user. If it was one of the âadminâ group, only the message âAdmin Viewâ.
Does it show nothing? Exactly, in both cases it does not show on any type of user.
Does it show the user view for both users? It does not show in both cases.
Does it show the admin view for both users? It does not show âadminâ view for both users.
Does it show the opposite view? Dont show nothing.
Does it show something completely different? Dont show nothing.
Thank you. I specifically meant what does "Not working" mean.
I don't have any ideas what might cause this... does it show anything if you set a default value?
Could you please try setting the entity to something else, to see if it's the group
option that's causing the problems?
I thank you! I would like to have this feature. I will do two tests in different scenarios to facilitate the identification of the problem.
See you later!
1st - Test: Redo the test as you requested and implement the "default" option.
- title: 'ConfiguraçÔes Administrador'
icon: mdi:settings
id: ADMSetupDeviceIoT
visible: true
cards:
- type: custom:state-switch
entity: group
default: default
states:
user:
type: entities
title: "Config TESTE"
show_header_toggle: false
entities:
- type: divider
admin:
type: entities
title: "Config GEORGE"
show_header_toggle: false
entities:
- type: divider
default:
type: entities
title: "Test default"
show_header_toggle: false
entities:
- type: divider
Result:
2nd - Test with 'entity: user' for comparison.
- title: 'ConfiguraçÔes Administrador'
icon: mdi:settings
id: ADMSetupDeviceIoT
visible: true
cards:
- type: custom:state-switch
entity: user
default: default
states:
"teste":
type: entities
title: "Configuração IoT-ADM"
show_header_toggle: false
entities:
- type: divider
"george":
type: entities
title: "Config GEORGE"
show_header_toggle: false
entities:
- type: divider
default:
type: entities
title: "Test default"
show_header_toggle: false
entities:
- type: divider
Result:
Thank you! I believe I found the problem.
Thank you!
It didn't work properly!
I did a test with 'entity: group' and recognizes both types of users as 'admin'
https://github.com/thomasloven/lovelace-state-switch/issues/35#issuecomment-642061572
type: custom:state-switch
entity: group
default: default
states:
admin:
type: markdown
content: "# ADMIN"
user:
type: markdown
content: "# USER"
default:
type: markdown
content: "# DEFAULT"
Can't reproduce
Exactly reproduce your code, and perform the tests with both users:
group / user = message "DEFAULT", only.
group / admin = message "DEFAULT", only.
But with your code above you get admin for both users?
if you refer to this code:
- title: 'ConfiguraçÔes Administrador'
icon: mdi:settings
id: ADMSetupDeviceIoT
visible: true
cards:
- type: custom:state-switch
entity: user
default: default
states:
"teste":
type: entities
title: "Configuração IoT-ADM"
show_header_toggle: false
entities:
- type: divider
"george":
type: entities
title: "Config GEORGE"
show_header_toggle: false
entities:
- type: divider
default:
type: entities
title: "Test default"
show_header_toggle: false
entities:
- type: divider
Result:
When using "state-switch" with the "group" option, it does not identify user "admin" or user "user". Two users were created, an administrator and another ordinary user.
H.A = 0.107.7; FireFox version 77.0.1 (64-bits) - (Desktop); Chrome version 83.0.4103.97 64 bits - (Desktop);