Standardize some entity constants naming

This commit is contained in:
2025-04-23 22:55:31 -04:00
parent b626b5b5e8
commit fefc52bd01
6 changed files with 29 additions and 29 deletions

View File

@ -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

View File

@ -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"