1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 19:32:19 +01:00
This commit is contained in:
J. Nick Koston
2025-08-20 13:09:15 -05:00
parent 2c44198cb5
commit 6c01e7196c

View File

@@ -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