mirror of
https://github.com/esphome/esphome.git
synced 2025-09-02 11:22:24 +01:00
preen
This commit is contained in:
@@ -89,6 +89,8 @@ class EntityBase {
|
|||||||
uint32_t get_preference_hash() {
|
uint32_t get_preference_hash() {
|
||||||
#ifdef USE_DEVICES
|
#ifdef USE_DEVICES
|
||||||
// Combine object_id_hash with device_id to ensure uniqueness across devices
|
// Combine object_id_hash with device_id to ensure uniqueness across devices
|
||||||
|
// Note: device_id is 0 for the main device, so XORing with 0 preserves the original hash
|
||||||
|
// This ensures backward compatibility for existing single-device configurations
|
||||||
return this->get_object_id_hash() ^ this->get_device_id();
|
return this->get_object_id_hash() ^ this->get_device_id();
|
||||||
#else
|
#else
|
||||||
// Without devices, just use object_id_hash as before
|
// Without devices, just use object_id_hash as before
|
||||||
|
Reference in New Issue
Block a user