Skip to content

Commit

Permalink
Documentation updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavlo Dudnytskyi committed Aug 22, 2024
1 parent e7dc56b commit ed65478
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 119 deletions.
8 changes: 8 additions & 0 deletions components/haier/haier_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,14 @@ void HaierClimateBase::loop() {
}
this->process_phase(now);
this->haier_protocol_.loop();
#ifdef USE_SWITCH
if ((this->display_switch_ != nullptr) && (this->display_switch_->state != this->get_display_state())) {
this->display_switch_->publish_state(this->get_display_state());
}
if ((this->health_mode_switch_ != nullptr) && (this->health_mode_switch_->state != this->get_health_mode())) {
this->health_mode_switch_->publish_state(this->get_health_mode());
}
#endif // USE_SWITCH
}

void HaierClimateBase::process_protocol_reset() {
Expand Down
42 changes: 7 additions & 35 deletions docs/examples/max-hon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,41 +93,13 @@ text_sensor:
name: Haier hOn Climate protocol version

switch:
- platform: template
id: haier_ac_beeper_switch
entity_category: config
name: Haier hOn Climate beeper
icon: mdi:volume-high
restore_mode: RESTORE_DEFAULT_ON
lambda: |-
return id(haier_ac).get_beeper_state();
turn_on_action:
climate.haier.beeper_on: haier_ac
turn_off_action:
climate.haier.beeper_off: haier_ac
- platform: template
id: haier_ac_health_mode
name: Haier hOn Climate health mode
icon: mdi:leaf
restore_mode: RESTORE_DEFAULT_OFF
lambda: |-
return id(haier_ac).get_health_mode();
turn_on_action:
climate.haier.health_on: haier_ac
turn_off_action:
climate.haier.health_off: haier_ac
- platform: template
id: haier_ac_display_switch
name: Haier hOn Climate display
icon: mdi:led-on
entity_category: config
restore_mode: RESTORE_DEFAULT_ON
lambda: |-
return id(haier_ac).get_display_state();
turn_on_action:
climate.haier.display_on: haier_ac
turn_off_action:
climate.haier.display_off: haier_ac
- platform: haier
beeper:
name: ${device_name} beeper
health_mode:
name: ${device_name} health mode
display:
name: ${device_name} display

select:
- platform: template
Expand Down
28 changes: 5 additions & 23 deletions docs/examples/max-smartair2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,8 @@ climate:
- AWAY

switch:
- platform: template
id: haier_ac_health_mode
name: Haier SmartAir2 Climate health mode
icon: mdi:leaf
restore_mode: RESTORE_DEFAULT_OFF
lambda: |-
return id(haier_ac).get_health_mode();
turn_on_action:
climate.haier.health_on: haier_ac
turn_off_action:
climate.haier.health_off: haier_ac
- platform: template
id: haier_ac_display_switch
name: Haier SmartAir2 Climate display
icon: mdi:led-on
entity_category: config
restore_mode: RESTORE_DEFAULT_ON
lambda: |-
return id(haier_ac).get_display_state();
turn_on_action:
climate.haier.display_on: haier_ac
turn_off_action:
climate.haier.display_off: haier_ac
- platform: haier
health_mode:
name: ${device_name} health mode
display:
name: ${device_name} display
44 changes: 8 additions & 36 deletions docs/hon_example.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. This file is automatically generated by ./docs/script/make_doc.py Python script.
.. This file is automatically generated by ./docs/script/process_examples.py Python script.
Please, don't change. In case you need to make corrections or changes change
source documentation in ./doc folder or script.
Expand Down Expand Up @@ -121,41 +121,13 @@ Maximum configuration witch will use all possible options will look like this:
name: Haier hOn Climate protocol version
switch:
- platform: template
id: haier_ac_beeper_switch
entity_category: config
name: Haier hOn Climate beeper
icon: mdi:volume-high
restore_mode: RESTORE_DEFAULT_ON
lambda: |-
return id(haier_ac).get_beeper_state();
turn_on_action:
climate.haier.beeper_on: haier_ac
turn_off_action:
climate.haier.beeper_off: haier_ac
- platform: template
id: haier_ac_health_mode
name: Haier hOn Climate health mode
icon: mdi:leaf
restore_mode: RESTORE_DEFAULT_OFF
lambda: |-
return id(haier_ac).get_health_mode();
turn_on_action:
climate.haier.health_on: haier_ac
turn_off_action:
climate.haier.health_off: haier_ac
- platform: template
id: haier_ac_display_switch
name: Haier hOn Climate display
icon: mdi:led-on
entity_category: config
restore_mode: RESTORE_DEFAULT_ON
lambda: |-
return id(haier_ac).get_display_state();
turn_on_action:
climate.haier.display_on: haier_ac
turn_off_action:
climate.haier.display_off: haier_ac
- platform: haier
beeper:
name: ${device_name} beeper
health_mode:
name: ${device_name} health mode
display:
name: ${device_name} display
select:
- platform: template
Expand Down
2 changes: 1 addition & 1 deletion docs/script/process_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os

document_header = [
".. This file is automatically generated by ./docs/script/make_doc.py Python script.\n",
".. This file is automatically generated by ./docs/script/process_examples.py Python script.\n",
" Please, don't change. In case you need to make corrections or changes change\n",
" source documentation in ./doc folder or script.\n\n"
]
Expand Down
30 changes: 6 additions & 24 deletions docs/smartair2_example.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. This file is automatically generated by ./docs/script/make_doc.py Python script.
.. This file is automatically generated by ./docs/script/process_examples.py Python script.
Please, don't change. In case you need to make corrections or changes change
source documentation in ./doc folder or script.
Expand Down Expand Up @@ -70,27 +70,9 @@ Maximum configuration witch will use all possible options will look like this:
- AWAY
switch:
- platform: template
id: haier_ac_health_mode
name: Haier SmartAir2 Climate health mode
icon: mdi:leaf
restore_mode: RESTORE_DEFAULT_OFF
lambda: |-
return id(haier_ac).get_health_mode();
turn_on_action:
climate.haier.health_on: haier_ac
turn_off_action:
climate.haier.health_off: haier_ac
- platform: template
id: haier_ac_display_switch
name: Haier SmartAir2 Climate display
icon: mdi:led-on
entity_category: config
restore_mode: RESTORE_DEFAULT_ON
lambda: |-
return id(haier_ac).get_display_state();
turn_on_action:
climate.haier.display_on: haier_ac
turn_off_action:
climate.haier.display_off: haier_ac
- platform: haier
health_mode:
name: ${device_name} health mode
display:
name: ${device_name} display

0 comments on commit ed65478

Please sign in to comment.