mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-06-23 05:31:47 +00:00
fix: Fix Home Assistant Entity category config is invalid for sensors warning https://github.com/Koenkk/zigbee2mqtt/issues/20252
This commit is contained in:
@@ -856,6 +856,12 @@ export default class HomeAssistant extends Extension {
|
||||
delete discoveryEntry.discovery_payload.device_class;
|
||||
}
|
||||
|
||||
// entity_category config is not allowed for sensors
|
||||
// https://github.com/Koenkk/zigbee2mqtt/issues/20252
|
||||
if (discoveryEntry.discovery_payload.entity_category === 'config') {
|
||||
delete discoveryEntry.discovery_payload.entity_category;
|
||||
}
|
||||
|
||||
// Let Home Assistant generate entity name when device_class is present
|
||||
if (discoveryEntry.discovery_payload.device_class) delete discoveryEntry.discovery_payload.name;
|
||||
|
||||
|
||||
@@ -1407,7 +1407,7 @@ describe('Publish', () => {
|
||||
expect(MQTT.publish.mock.calls[3]).toEqual([ 'zigbee2mqtt/bulb_color', stringify({"state":"ON","brightness":150}), { qos: 0, retain: false }, expect.any(Function)]);
|
||||
});
|
||||
|
||||
it('onlythis Scenes', async () => {
|
||||
it('Scenes', async () => {
|
||||
const bulb_color_2 = zigbeeHerdsman.devices.bulb_color_2.getEndpoint(1);
|
||||
const bulb_2 = zigbeeHerdsman.devices.bulb_2.getEndpoint(1);
|
||||
const group = zigbeeHerdsman.groups.group_tradfri_remote;
|
||||
|
||||
Reference in New Issue
Block a user