mirror of
https://github.com/GrKoR/esphome_aux_ac_component.git
synced 2025-12-21 15:08:19 +03:00
ext & local test.yaml + minor changes
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
||||
# Gitignore settings for ESPHome
|
||||
# This is an example and may include too much for your use-case.
|
||||
# You can modify this file to suit your needs.
|
||||
**/.vscode/
|
||||
**/.esphome/
|
||||
**/.pioenvs/
|
||||
**/.piolibdeps/
|
||||
|
||||
@@ -2284,6 +2284,13 @@ class AirCon : public esphome::Component, public esphome::climate::Climate {
|
||||
};
|
||||
|
||||
void loop() override {
|
||||
if ((millis()-_dataMillis) > 3000){
|
||||
_dataMillis = millis();
|
||||
_debugMsg(F("current status:"), ESPHOME_LOG_LEVEL_DEBUG, __LINE__);
|
||||
_debugMsg(F(" _hw_initialized = %02X"), ESPHOME_LOG_LEVEL_DEBUG, __LINE__, this->_hw_initialized);
|
||||
_debugMsg(F(" _has_connection = %02X"), ESPHOME_LOG_LEVEL_DEBUG, __LINE__, this->_has_connection);
|
||||
}
|
||||
|
||||
if (!get_hw_initialized()) return;
|
||||
|
||||
/// отрабатываем состояния конечного автомата
|
||||
@@ -2313,6 +2320,9 @@ class AirCon : public esphome::Component, public esphome::climate::Climate {
|
||||
if ((millis()-_dataMillis) > _update_period){
|
||||
_dataMillis = millis();
|
||||
|
||||
_debugMsg(F("update period:"), ESPHOME_LOG_LEVEL_DEBUG, __LINE__);
|
||||
_debugMsg(F(" _hw_initialized = %02X)"), ESPHOME_LOG_LEVEL_DEBUG, __LINE__, this->_hw_initialized);
|
||||
_debugMsg(F(" _has_connection = %02X)"), ESPHOME_LOG_LEVEL_DEBUG, __LINE__, this->_has_connection);
|
||||
// обычный wifi-модуль запрашивает маленький пакет статуса
|
||||
// но нам никто не мешает запрашивать и большой и маленький, чтобы чаще обновлять комнатную температуру
|
||||
// делаем этот запросом только в случае, если есть коннект с кондиционером
|
||||
@@ -2321,21 +2331,5 @@ class AirCon : public esphome::Component, public esphome::climate::Climate {
|
||||
};
|
||||
};
|
||||
|
||||
//AirCon acAirCon;
|
||||
|
||||
/*
|
||||
class AirConFirmwareVersion: public esphome::PollingComponent, public esphome::text_sensor::TextSensor {
|
||||
public:
|
||||
AirConFirmwareVersion() : PollingComponent(1*60*1000) {} // 1 minute update interval
|
||||
|
||||
void setup() override {
|
||||
}
|
||||
|
||||
void update() override {
|
||||
publish_state(Constants::AC_ROVEX_FIRMWARE_VERSION);
|
||||
}
|
||||
};
|
||||
*/
|
||||
|
||||
} // namespace aux_ac
|
||||
} // namespace esphome
|
||||
78
tests/test-ext.yaml
Normal file
78
tests/test-ext.yaml
Normal file
@@ -0,0 +1,78 @@
|
||||
external_components:
|
||||
- source: github://GrKoR/esphome_aux_ac_component@dev
|
||||
components: [ aux_ac ]
|
||||
|
||||
esphome:
|
||||
name: test_aux_ac_local
|
||||
platform: ESP8266
|
||||
board: esp12e
|
||||
|
||||
wifi:
|
||||
ssid: !secret wifi_ssid
|
||||
password: !secret wifi_pass
|
||||
manual_ip:
|
||||
static_ip: !secret wifi_ip
|
||||
gateway: !secret wifi_gateway
|
||||
subnet: !secret wifi_subnet
|
||||
dns1: 8.8.8.8
|
||||
dns2: 1.1.1.1
|
||||
reboot_timeout: 0s
|
||||
ap:
|
||||
ssid: Test AUX Fallback Hotspot
|
||||
password: !secret wifi_ap_pass
|
||||
|
||||
logger:
|
||||
level: DEBUG
|
||||
baud_rate: 0
|
||||
|
||||
api:
|
||||
password: !secret api_pass
|
||||
reboot_timeout: 0s
|
||||
|
||||
ota:
|
||||
password: !secret ota_pass
|
||||
|
||||
uart:
|
||||
id: ac_uart_bus
|
||||
tx_pin: GPIO1
|
||||
rx_pin: GPIO3
|
||||
baud_rate: 4800
|
||||
data_bits: 8
|
||||
parity: EVEN
|
||||
stop_bits: 1
|
||||
|
||||
sensor:
|
||||
- platform: uptime
|
||||
name: Uptime Sensor
|
||||
|
||||
climate:
|
||||
- platform: aux_ac
|
||||
name: "AC Name"
|
||||
id: aux_id
|
||||
uart_id: ac_uart_bus
|
||||
period: 7s # период опроса состояния сплита, по дефолту 7 сек
|
||||
show_action: true # надо ли показывать текущий режим работы: при HEAT_COOL mode сплит может греть (HEAT), охлаждать (COOL) или бездействовать (IDLE)
|
||||
visual:
|
||||
min_temperature: 16
|
||||
max_temperature: 32
|
||||
temperature_step: 0.5
|
||||
supported_modes:
|
||||
- HEAT_COOL # не AUTO, так как только нагревает и остужает. В доках на ESPHome говорится, что AUTO - это если у устройства есть календарь и какие-то установки по расписанию.
|
||||
- COOL
|
||||
- HEAT
|
||||
- DRY
|
||||
- FAN_ONLY
|
||||
custom_fan_modes:
|
||||
- MUTE
|
||||
- TURBO
|
||||
supported_presets:
|
||||
- SLEEP
|
||||
custom_presets:
|
||||
- CLEAN
|
||||
- FEEL
|
||||
- HEALTH
|
||||
- ANTIFUNGUS
|
||||
supported_swing_modes:
|
||||
- VERTICAL
|
||||
- HORIZONTAL
|
||||
- BOTH
|
||||
@@ -4,7 +4,7 @@ external_components:
|
||||
path: ..\components
|
||||
|
||||
esphome:
|
||||
name: test_aux_ac
|
||||
name: test_aux_ac_local
|
||||
platform: ESP8266
|
||||
board: esp12e
|
||||
|
||||
Reference in New Issue
Block a user