Page 1 sur 1

Icones personnalisées on/off

Publié : 16 avr. 2020, 01:15
par xavierlp
Bonjour à tous

J'ai un comportement que je ne m'explique pas.
Sur mes interrupteurs lightning 1, je peux changer l'icone via la liste déroulante
bureau Light 1.png
bureau Light 1.png (10.84 Kio) Consulté 1917 fois
bureau Light 2.png
bureau Light 2.png (14.07 Kio) Consulté 1917 fois
Mais sur ceux en lightning 6 pas d'option...
entree Light 1.png
entree Light 1.png (12 Kio) Consulté 1917 fois
entree Light 2.png
entree Light 2.png (12.5 Kio) Consulté 1917 fois
Existe-t-il une option pour cela.

J'aimerais avoir des icones très personnlisées.

J'ai bien pensé à un dummy pour piloter le réel mais cela fait bazzoka pour un détail

Merci

Re: Icones personnalisées on/off

Publié : 16 avr. 2020, 12:55
par xavierlp
Pour permettre au lightning 6 d'avoir le choix d'une icone il faut changer la ligne 8 dans le fichier :

<domoticz dir>/www/app/devices/deviceFactory.js

return ['Light/Switch', 'Lighting 1', 'Lighting 2', 'Lighting 5','Color Switch'].includes(device.Type) &&

return ['Light/Switch', 'Lighting 1', 'Lighting 2', 'Lighting 5','Lighting 6','Color Switch'].includes(device.Type) &&

Redemarrer Domoticz ensuite.

https://www.domoticz.com/forum/viewtopi ... 28&t=32213

Re: Icones personnalisées on/off

Publié : 31 juil. 2022, 17:35
par jackyhi
Je détère un vieux sujet (16 avril 2020)!,
Est ce que la méthode fonctionne pour les lighting 4 ??

Re: Icones personnalisées on/off

Publié : 31 juil. 2022, 19:30
par denis_brasseur
Il te suffit d'essayer pour le savoir, je dirais que oui.

Re: Icones personnalisées on/off

Publié : 31 juil. 2022, 23:53
par jackyhi
Je viens de tenter la méthode préconisée par xavierlp » 16 avr. 2020, 12:55 pour les lighting 6.

Ca fonctionne !!
j'ai modifié simplement la ligne suivante du fichier "/home/pi/domoticz/www/app/devices/deviceFactory.js" qui était:

Code : Tout sélectionner

return ['Light/Switch', 'Lighting 1', 'Lighting 2',  'Lighting 5','Lighting 6','Color Switch','Home Confort','Thermostat 3'].includes(device.Type) &&
                    [0, 2, 7, 9, 10, 11, 17, 18, 19, 20].includes(device.SwitchTypeVal);
par celle ci-dessous, j'ai rebooter le Pi et effacer l'historique du navigateur et miracle j'ai pu changer l'icône ampoule traditionnelle par mon icône personnelle.
ma nouvelle ligne:

Code : Tout sélectionner

 return ['Light/Switch', 'Lighting 1', 'Lighting 2', [u][b]'Lighting 4',[/b][/u] 'Lighting 5','Lighting 6','Color Switch','Home Confort','Thermostat 3'].includes(device.Type) &&
                    [0, 2, 7, 9, 10, 11, 17, 18, 19, 20].includes(device.SwitchTypeVal);