1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-03 18:42:23 +01:00

make areas and devices consistant

This commit is contained in:
J. Nick Koston
2025-06-21 17:30:17 +02:00
parent 4a7958586e
commit fad86c655e

22
esphome/core/device.h Normal file
View File

@@ -0,0 +1,22 @@
#pragma once
#include "esphome/core/string_ref.h"
namespace esphome {
class Device {
public:
void set_device_id(uint32_t device_id) { device_id_ = device_id; }
uint32_t get_device_id() { return device_id_; }
void set_name(const char *name) { name_ = name; }
const char *get_name() { return name_; }
void set_area_id(uint32_t area_id) { area_id_ = area_id; }
uint32_t get_area_id() { return area_id_; }
protected:
uint32_t device_id_{};
uint32_t area_id_{};
const char *name_ = "";
};
} // namespace esphome