Je viens de réaliser mon premier script lua pour allumer ma YeelightColor Bulb avec mon Switch Xiaomi et j'ai une erreur dans les logs, j'ai résolu d'autres erreurs mais je ne vois pas, est-ce un problème de paramètre de l'éditeur de text?
Voici le contenu du script en Unicode (UTF-8), Unix (LF), je l'ai écrit avec TextWrangler sous MacOs:
Code : Tout sélectionner
-- Avec Switch_Salon allumage LuxColor_Salon
commandArray = {}
if (devicechanged['Switch_Salon'] and otherdevices['LuxColor_Salon'] == 'Off') then
commandArray['LuxColor_Salon']='On'
print ("Lumiere_allumee")
elseif (devicechanged['Switch_Salon'] and otherdevices['LuxColor_Salon'] ~= 'Off') then
commandArray['LuxColor_Salon']='Off'
print ("Lumiere_eteinte")
end
return commandArray