Skip to content

Commit

Permalink
Merge pull request #59 from muart-group/fix-battsensor
Browse files Browse the repository at this point in the history
Re-add battery text-sensor
  • Loading branch information
Sammy1Am authored Oct 8, 2024
2 parents cd2414e + 5ccc992 commit 5751221
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,11 @@ void ErrorCodeSensor::process_packet(const ErrorStateGetResponsePacket &packet)
}
}

void ThermostatBatterySensor::process_packet(const ThermostatSensorStatusPacket &packet) {
if (packet.get_flags() & 0x08) {
mitp_text_sensor_state_ = THERMOSTAT_BATTERY_STATE_NAMES[packet.get_thermostat_battery_state()];
}
}

} // namespace mitsubishi_itp
} // namespace esphome
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ class ErrorCodeSensor : public MITPTextSensor {
void process_packet(const ErrorStateGetResponsePacket &packet) override;
};

class ThermostatBatterySensor : public MITPTextSensor {
void process_packet(const ThermostatSensorStatusPacket &packet) override;
};

} // namespace mitsubishi_itp
} // namespace esphome

0 comments on commit 5751221

Please sign in to comment.