1
0
mirror of https://github.com/esphome/esphome.git synced 2025-01-18 12:05:41 +00:00

Remove commented code

This commit is contained in:
Mateusz Wójcik 2025-01-07 16:39:44 +01:00
parent e7be621cf0
commit 63d0622c38

View File

@ -98,58 +98,3 @@ class HeaterState {
} // namespace diesel_heater_ble
} // namespace esphome
// // Represents the current system state
// class HeaterState {
// public:
// // Decoded fields from the response
// uint16_t deviceStatusFlags; // Device status flags (on/off, error states)
// uint16_t tempSetpoint; // Temperature setpoint
// uint16_t currentTemperature; // Current temperature
// uint16_t altitude; // Altitude in meters or feet
// uint8_t batteryVoltage; // Battery voltage (scaled)
// uint8_t fuelLevel; // Remaining fuel level
// uint8_t operatingMode; // Current operating mode
// uint8_t errorCode; // Error code
// uint32_t runtimeCounter; // Total runtime (in minutes or seconds)
// uint8_t additionalStatus[10]; // Placeholder for additional statuses
// // Decode raw response into meaningful fields
// static std::vector<uint8_t> decode(const std::vector<uint8_t> &raw) {
// if (raw.size() != 48 || raw[0] != 0xAA || raw[1] != 0x55) {
// throw std::invalid_argument("Invalid packet format");
// }
// std::vector<uint8_t> decoded;
// decoded.push_back(raw[3] | (raw[4] << 8));
// decoded.push_back(raw[5] | (raw[6] << 8));
// decoded.push_back(raw[7] | (raw[8] << 8));
// decoded.push_back(raw[9] | (raw[10] << 8));
// decoded.push_back(raw[11]);
// decoded.push_back(raw[12]);
// decoded.push_back(raw[13]);
// decoded.push_back(raw[14]);
// decoded.push_back(raw[15] | (raw[16] << 8) | (raw[17] << 16) | (raw[18] << 24));
// std::memcpy(&decoded[9], &raw[19], 10);
// return decoded;
// }
// static HeaterState decompose(const std::vector<uint8_t> &raw) {
// if (raw.size() != 48 || raw[0] != 0xAA || raw[1] != 0x55) {
// throw std::invalid_argument("Invalid packet format");
// }
// HeaterState state;
// state.deviceStatusFlags = raw[3] | (raw[4] << 8);
// state.tempSetpoint = raw[5] | (raw[6] << 8);
// state.currentTemperature = raw[7] | (raw[8] << 8);
// state.altitude = raw[9] | (raw[10] << 8);
// state.batteryVoltage = raw[11];
// state.fuelLevel = raw[12];
// state.operatingMode = raw[13];
// state.errorCode = raw[14];
// state.runtimeCounter = raw[15] | (raw[16] << 8) | (raw[17] << 16) | (raw[18] << 24);
// std::memcpy(state.additionalStatus, &raw[19], 10);
// return state;
// }
// };