1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00

Refactor fan platform to resemble climate/cover platforms (#2848)

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: rob-deutsch <robzyb+altgithub@gmail.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Oxan van Leeuwen
2022-01-23 10:21:54 +01:00
committed by GitHub
parent 8187a4bce9
commit 2a84db7f85
41 changed files with 593 additions and 506 deletions

View File

@@ -127,7 +127,7 @@ void PrometheusHandler::fan_type_(AsyncResponseStream *stream) {
stream->print(F("#TYPE esphome_fan_speed GAUGE\n"));
stream->print(F("#TYPE esphome_fan_oscillation GAUGE\n"));
}
void PrometheusHandler::fan_row_(AsyncResponseStream *stream, fan::FanState *obj) {
void PrometheusHandler::fan_row_(AsyncResponseStream *stream, fan::Fan *obj) {
if (obj->is_internal())
return;
stream->print(F("esphome_fan_failed{id=\""));

View File

@@ -52,7 +52,7 @@ class PrometheusHandler : public AsyncWebHandler, public Component {
/// Return the type for prometheus
void fan_type_(AsyncResponseStream *stream);
/// Return the sensor state as prometheus data point
void fan_row_(AsyncResponseStream *stream, fan::FanState *obj);
void fan_row_(AsyncResponseStream *stream, fan::Fan *obj);
#endif
#ifdef USE_LIGHT