Standardize some entity constants naming
This commit is contained in:
@ -4,7 +4,7 @@ const ac = global.get('emmaBedroom.aircon.installed', "diskCon")
|
||||
const lastMode = flow.get("emmaBedroom.lastMode", "diskCon")
|
||||
const bedTemp = states['input_number.emma_bedroom_bedtime_temp'].state
|
||||
|
||||
const emmaBedroomAircon = ["climate.emma_bedroom_aircon"]
|
||||
const airconEntity = ["climate.emma_bedroom_aircon"]
|
||||
|
||||
let setTemp = bedTemp
|
||||
let setEco = 'turn_off'
|
||||
@ -15,7 +15,7 @@ let sendHvac = {
|
||||
"payload": {
|
||||
"action": "climate.set_hvac_mode",
|
||||
"target": {
|
||||
"entity_id": emmaBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"hvac_mode": setHvac
|
||||
@ -27,7 +27,7 @@ let sendTemp = {
|
||||
"payload": {
|
||||
"action": "climate.set_temperature",
|
||||
"target": {
|
||||
"entity_id": emmaBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"temperature": setTemp
|
||||
@ -49,7 +49,7 @@ let sendAcFan = {
|
||||
"payload": {
|
||||
"action": "climate.set_fan_mode",
|
||||
"target": {
|
||||
"entity_id": emmaBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"fan_mode": setAcFan
|
||||
|
@ -22,8 +22,8 @@ node.log("Emma Bedroom Climate: Constants Set")
|
||||
|
||||
// Define reusable constants
|
||||
|
||||
const emmaBedroomAircon = ["climate.emma_bedroom_aircon"]
|
||||
const emmaBedroomWhiteNoise = ["input_boolean.white_noise_emma_bedroom"]
|
||||
const airconEntity = ["climate.emma_bedroom_aircon"]
|
||||
const whiteNoiseEntity = ["input_boolean.white_noise_emma_bedroom"]
|
||||
const validSchedModesAC = ['AC', 'Fan']
|
||||
|
||||
// Helper function to convert a string to title case
|
||||
@ -209,7 +209,7 @@ let sendWhiteNoise = {
|
||||
"payload": {
|
||||
"action": `input_boolean.${setWhiteNoise}`,
|
||||
"target": {
|
||||
"entity_id": emmaBedroomWhiteNoise
|
||||
"entity_id": whiteNoiseEntity
|
||||
},
|
||||
"data": {}
|
||||
}
|
||||
@ -225,7 +225,7 @@ let sendHvac = {
|
||||
"payload": {
|
||||
"action": "climate.set_hvac_mode",
|
||||
"target": {
|
||||
"entity_id": emmaBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"hvac_mode": setHvac
|
||||
@ -237,7 +237,7 @@ let sendTemp = {
|
||||
"payload": {
|
||||
"action": "climate.set_temperature",
|
||||
"target": {
|
||||
"entity_id": emmaBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"temperature": setTemp
|
||||
@ -259,7 +259,7 @@ let sendAcFan = {
|
||||
"payload": {
|
||||
"action": "climate.set_fan_mode",
|
||||
"target": {
|
||||
"entity_id": emmaBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"fan_mode": "auto"
|
||||
|
@ -4,8 +4,8 @@ const ac = global.get('masterBedroom.aircon.installed', "diskCon")
|
||||
const lastMode = flow.get("masterBedroom.lastMode", "diskCon")
|
||||
const bedTemp = states['input_number.master_bedroom_bedtime_temp'].state
|
||||
|
||||
const masterBedroomAircon = ["climate.master_bedroom_aircon"]
|
||||
const masterBedroomFan = ["fan.master_bedroom_fan"]
|
||||
const airconEntity = ["climate.master_bedroom_aircon"]
|
||||
const fanEntity = ["fan.master_bedroom_fan"]
|
||||
|
||||
let setTemp = bedTemp
|
||||
let setEco = 'turn_off'
|
||||
@ -17,7 +17,7 @@ let sendFan = {
|
||||
"payload": {
|
||||
"action": `fan.${setFan}`,
|
||||
"target": {
|
||||
"entity_id": masterBedroomFan
|
||||
"entity_id": fanEntity
|
||||
},
|
||||
"data": {}
|
||||
}
|
||||
@ -27,7 +27,7 @@ let sendHvac = {
|
||||
"payload": {
|
||||
"action": "climate.set_hvac_mode",
|
||||
"target": {
|
||||
"entity_id": masterBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"hvac_mode": setHvac
|
||||
@ -39,7 +39,7 @@ let sendTemp = {
|
||||
"payload": {
|
||||
"action": "climate.set_temperature",
|
||||
"target": {
|
||||
"entity_id": masterBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"temperature": setTemp
|
||||
@ -61,7 +61,7 @@ let sendAcFan = {
|
||||
"payload": {
|
||||
"action": "climate.set_fan_mode",
|
||||
"target": {
|
||||
"entity_id": masterBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"fan_mode": setAcFan
|
||||
|
@ -27,8 +27,8 @@ node.log("Master Bedroom Climate: Constants Set")
|
||||
|
||||
// Define some entity IDs
|
||||
|
||||
const masterBedroomAircon = ["climate.master_bedroom_aircon"]
|
||||
const masterBedroomFan = ["fan.master_bedroom_fan"]
|
||||
const airconEntity = ["climate.master_bedroom_aircon"]
|
||||
const fanEntity = ["fan.master_bedroom_fan"]
|
||||
const peopleIDs = ["input_boolean.tony_awake", "input_boolean.tina_awake"]
|
||||
|
||||
// Helper function to convert a string to title case
|
||||
@ -200,7 +200,7 @@ let sendFan = {
|
||||
"payload": {
|
||||
"action": `fan.${setFan}`,
|
||||
"target": {
|
||||
"entity_id": masterBedroomFan
|
||||
"entity_id": fanEntity
|
||||
},
|
||||
"data": {}
|
||||
}
|
||||
@ -264,7 +264,7 @@ let sendHvac = {
|
||||
"payload": {
|
||||
"action": "climate.set_hvac_mode",
|
||||
"target": {
|
||||
"entity_id": masterBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"hvac_mode": setHvac
|
||||
@ -276,7 +276,7 @@ let sendTemp = {
|
||||
"payload": {
|
||||
"action": "climate.set_temperature",
|
||||
"target": {
|
||||
"entity_id": masterBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"temperature": setTemp
|
||||
@ -298,7 +298,7 @@ let sendAcFan = {
|
||||
"payload": {
|
||||
"action": "climate.set_fan_mode",
|
||||
"target": {
|
||||
"entity_id": masterBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"fan_mode": "auto"
|
||||
|
@ -11,7 +11,7 @@ const sleeping = states['input_boolean.master_bedroom_sleeping'].state
|
||||
const hotDay = states['input_boolean.hot_day'].state
|
||||
const topic = msg.topic
|
||||
|
||||
const masterBedroomAircon = ["climate.master_bedroom_aircon"]
|
||||
const airconEntity = ["climate.master_bedroom_aircon"]
|
||||
|
||||
let setTemp = {}
|
||||
let setEco = {}
|
||||
@ -72,7 +72,7 @@ let sendHvac = {
|
||||
"payload": {
|
||||
"action": "climate.set_hvac_mode",
|
||||
"target": {
|
||||
"entity_id": masterBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"hvac_mode": setHvac
|
||||
@ -84,7 +84,7 @@ let sendTemp = {
|
||||
"payload": {
|
||||
"action": "climate.set_temperature",
|
||||
"target": {
|
||||
"entity_id": masterBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"temperature": setTemp
|
||||
@ -106,7 +106,7 @@ let sendAcFan = {
|
||||
"payload": {
|
||||
"action": "climate.set_fan_mode",
|
||||
"target": {
|
||||
"entity_id": masterBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"fan_mode": "auto"
|
||||
|
@ -6,7 +6,7 @@ const nightTemp = states['input_number.master_bedroom_night_temp'].state
|
||||
const bedTemp = states['input_number.master_bedroom_bedtime_temp'].state
|
||||
const sleeping = states['input_boolean.master_bedroom_sleeping'].state
|
||||
|
||||
const masterBedroomAircon = ["climate.master_bedroom_aircon"]
|
||||
const airconEntity = ["climate.master_bedroom_aircon"]
|
||||
|
||||
let setTemp = []
|
||||
let setHvac = "dry"
|
||||
@ -22,7 +22,7 @@ let sendHvac = {
|
||||
"payload": {
|
||||
"action": "climate.set_hvac_mode",
|
||||
"target": {
|
||||
"entity_id": masterBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"hvac_mode": setHvac
|
||||
@ -34,7 +34,7 @@ let sendTemp = {
|
||||
"payload": {
|
||||
"action": "climate.set_temperature",
|
||||
"target": {
|
||||
"entity_id": masterBedroomAircon
|
||||
"entity_id": airconEntity
|
||||
},
|
||||
"data": {
|
||||
"temperature": setTemp
|
||||
|
Reference in New Issue
Block a user