Skip to content

Commit

Permalink
Merge 6c56798 into d08803b
Browse files Browse the repository at this point in the history
  • Loading branch information
cweitkamp authored May 30, 2021
2 parents d08803b + 6c56798 commit fcfbdd8
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ export default {
case 'speakers':
equipment = [
...findEquipment(this.element.equipment, 'Equipment_Receiver', false),
...findEquipment(this.element.equipment, 'Equipment_Speaker', false)
...findEquipment(this.element.equipment, 'Equipment_Speaker', false),
...findEquipment(this.element.equipment, 'Equipment_VoiceAssistant', false)
]
if (!equipment.length) return []
allPoints = allEquipmentPoints(equipment)
Expand Down Expand Up @@ -189,10 +190,14 @@ export default {
return this.map.filter((state) => expr.eval(ast, { state: state, Number: Number })).length
}
switch (this.type) {
case 'lights':
return this.map.filter((state) => state === 'ON' || (state.split(',').length === 3 && state.split(',')[2] !== '0') || (state.indexOf(',') < 0 && Number.parseInt(state) > 0)).length
case 'blinds':
return this.map.filter((state) => state === 'OPEN' || state === 'ON' || Number.parseInt(state) === 0).length
case 'lights':
return this.map.filter((state) => state === 'ON' || (state.split(',').length === 3 && state.split(',')[2] !== '0') || (state.indexOf(',') < 0 && Number.parseInt(state) > 0)).length
case 'projectors':
case 'screens':
case 'speakers':
return this.map.filter((state) => state === 'ON' || state === 'PLAY' || state === 'FASTFORWARD' || state === 'REWIND').length
default:
return this.map.filter((state) => state === 'ON' || state === 'OPEN').length
}
Expand Down

0 comments on commit fcfbdd8

Please sign in to comment.