fix: Fix entity category for Home Assistant binary_sensor https://github.com/Koenkk/zigbee2mqtt/pull/19474

This commit is contained in:
koenkk
2023-11-05 20:56:06 +01:00
parent 366e29d4d9
commit 071842ef49
+1 -1
View File
@@ -969,7 +969,7 @@ export default class HomeAssistant extends Extension {
// If a sensor has entity category `config`, then change
// it to `diagnostic`. Sensors have no input, so can't be configured.
// https://github.com/Koenkk/zigbee2mqtt/pull/19474
if (d.type === 'sensor' && d.discovery_payload.entity_category === 'config') {
if (['binary_sensor', 'sensor'].includes(d.type) && d.discovery_payload.entity_category === 'config') {
d.discovery_payload.entity_category = 'diagnostic';
}
});