Skip to content

Commit

Permalink
fix: Fix entity category for Home Assistant binary_sensor #19474
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Nov 5, 2023
1 parent 366e29d commit 071842e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/extension/homeassistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
});
Expand Down

0 comments on commit 071842e

Please sign in to comment.