代码: 全选
commandArray = {}
if devicechanged['餐厅风扇'] ~= 'Off' and otherdevices['餐厅风扇 HomeKit'] == 'Off' then
commandArray['餐厅风扇 HomeKit'] = 'On'
elseif devicechanged['餐厅风扇'] == 'Off' and otherdevices['餐厅风扇 HomeKit'] == 'On' then
commandArray['餐厅风扇 HomeKit'] = 'Off'
elseif devicechanged['餐厅风扇 HomeKit'] == 'On' and otherdevices['餐厅风扇'] == 'Off' then
commandArray['餐厅风扇'] = 'Set Level 10'
elseif devicechanged['餐厅风扇 HomeKit'] == 'Off' and otherdevices['餐厅风扇'] ~= 'Off' then
commandArray['餐厅风扇'] = 'Off'
end
return commandArray