v.0.2.1 - display state

This commit is contained in:
GrKoR
2022-04-18 01:42:44 +03:00
parent 7f02c8843e
commit 75bdee1c2c
3 changed files with 23 additions and 6 deletions

View File

@@ -49,7 +49,7 @@ public:
static const uint32_t AC_STATES_REQUEST_INTERVAL; static const uint32_t AC_STATES_REQUEST_INTERVAL;
}; };
const std::string Constants::AC_ROVEX_FIRMWARE_VERSION = "0.2.0"; const std::string Constants::AC_ROVEX_FIRMWARE_VERSION = "0.2.1";
const char *const Constants::TAG = "AirCon"; const char *const Constants::TAG = "AirCon";
const std::string Constants::MUTE = "mute"; const std::string Constants::MUTE = "mute";
const std::string Constants::TURBO = "turbo"; const std::string Constants::TURBO = "turbo";

View File

@@ -15,7 +15,6 @@ from esphome.const import (
ICON_THERMOMETER, ICON_THERMOMETER,
DEVICE_CLASS_TEMPERATURE, DEVICE_CLASS_TEMPERATURE,
STATE_CLASS_MEASUREMENT, STATE_CLASS_MEASUREMENT,
DEVICE_CLASS_EMPTY,
) )
from esphome.components.climate import ( from esphome.components.climate import (
ClimateMode, ClimateMode,
@@ -102,11 +101,10 @@ CONFIG_SCHEMA = cv.All(
} }
), ),
cv.Optional(CONF_DISPLAY_STATE): binary_sensor.binary_sensor_schema( cv.Optional(CONF_DISPLAY_STATE): binary_sensor.binary_sensor_schema(
icon=ICON_DISPLAY, icon=ICON_DISPLAY
device_class=DEVICE_CLASS_EMPTY,
).extend( ).extend(
{ {
cv.Optional(CONF_INTERNAL, default="true"): cv.boolean, cv.Optional(CONF_INTERNAL, default="true"): cv.boolean
} }
), ),
cv.Optional(CONF_SUPPORTED_MODES): cv.ensure_list(validate_modes), cv.Optional(CONF_SUPPORTED_MODES): cv.ensure_list(validate_modes),

View File

@@ -60,6 +60,10 @@ climate:
name: AC Indoor Temperature name: AC Indoor Temperature
id: ac_indoor_temp id: ac_indoor_temp
internal: false # сенсор установлен как внутренний по дефолту (не попадёт в Home Assistant) internal: false # сенсор установлен как внутренний по дефолту (не попадёт в Home Assistant)
display_state:
name: AC Display State
id: ac_display_state
internal: false # сенсор установлен как внутренний по дефолту (не попадёт в Home Assistant)
visual: visual:
min_temperature: 16 min_temperature: 16
max_temperature: 32 max_temperature: 32
@@ -84,3 +88,18 @@ climate:
- VERTICAL - VERTICAL
- HORIZONTAL - HORIZONTAL
- BOTH - BOTH
switch:
- platform: template
name: AC Display
lambda: |-
if (ac_display_state).state) {
return true;
} else {
return false;
}
turn_on_action:
- aux_ac.display_on: aux_id
turn_off_action:
- aux_ac.display_off: aux_id