Skip to content

Commit

Permalink
fix!: Remove deprecated Home Assistant integration features (#24494)
Browse files Browse the repository at this point in the history
* Remove `legacy_trigger`

* Remove legacy_entity_attributes

* Remove `LEGACY_MAPPING`

* Finish cleanup

* Updates

* revert some entities removal

* Update

* Updates
  • Loading branch information
Koenkk committed Dec 1, 2024
1 parent 61cf509 commit e290057
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 273 deletions.
2 changes: 0 additions & 2 deletions lib/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ declare global {
homeassistant?: {
discovery_topic: string;
status_topic: string;
legacy_entity_attributes: boolean;
legacy_triggers: boolean;
experimental_event_entities: boolean;
};
availability?: {
Expand Down
24 changes: 0 additions & 24 deletions lib/util/settings.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,13 @@
"type": "object",
"title": "Home Assistant (advanced)",
"properties": {
"legacy_triggers": {
"type": "boolean",
"title": "Home Assistant legacy triggers",
"description": "Home Assistant legacy triggers, when enabled Zigbee2mqt will send an empty 'action' or 'click' after one has been send. A 'sensor_action' and 'sensor_click' will be discoverd",
"default": true
},
"discovery_topic": {
"type": "string",
"title": "Homeassistant discovery topic",
"description": "Home Assistant discovery topic",
"requiresRestart": true,
"examples": ["homeassistant"]
},
"legacy_entity_attributes": {
"type": "boolean",
"title": "Home Assistant legacy entity attributes",
"description": "Home Assistant legacy entity attributes, when enabled Zigbee2MQTT will add state attributes to each entity, additional to the separate entities and devices it already creates",
"default": true
},
"status_topic": {
"type": "string",
"title": "Home Assistant status topic",
Expand Down Expand Up @@ -726,25 +714,13 @@
"requiresRestart": true,
"examples": ["homeassistant"]
},
"homeassistant_legacy_entity_attributes": {
"type": "boolean",
"title": "Home Assistant legacy entity attributes",
"description": "Home Assistant legacy entity attributes, when enabled Zigbee2MQTT will add state attributes to each entity, additional to the separate entities and devices it already creates",
"default": true
},
"homeassistant_status_topic": {
"type": "string",
"title": "Home Assistant status topic",
"description": "Home Assistant status topic",
"requiresRestart": true,
"examples": ["homeassistant/status"]
},
"homeassistant_legacy_triggers": {
"type": "boolean",
"title": "Home Assistant legacy triggers",
"description": "Home Assistant legacy triggers, when enabled Zigbee2mqt will send an empty 'action' or 'click' after one has been send. A 'sensor_action' and 'sensor_click' will be discovered",
"default": true
},
"baudrate": {
"type": "number",
"title": "Baudrate (deprecated)",
Expand Down
11 changes: 1 addition & 10 deletions lib/util/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ objectAssignDeep(schema, schemaJson);
// Remove legacy settings from schema
{
delete schema.properties.advanced.properties.homeassistant_discovery_topic;
delete schema.properties.advanced.properties.homeassistant_legacy_entity_attributes;
delete schema.properties.advanced.properties.homeassistant_legacy_triggers;
delete schema.properties.advanced.properties.homeassistant_status_topic;
delete schema.properties.advanced.properties.baudrate;
delete schema.properties.advanced.properties.rtscts;
Expand Down Expand Up @@ -127,18 +125,11 @@ function loadSettingsWithDefaults(): void {
const defaults = {
discovery_topic: 'homeassistant',
status_topic: 'hass/status',
legacy_entity_attributes: true,
legacy_triggers: true,
experimental_event_entities: false,
};
const sLegacy = {};
if (_settingsWithDefaults.advanced) {
for (const key of [
'homeassistant_legacy_triggers',
'homeassistant_discovery_topic',
'homeassistant_legacy_entity_attributes',
'homeassistant_status_topic',
]) {
for (const key of ['homeassistant_discovery_topic', 'homeassistant_status_topic']) {
// @ts-expect-error ignore typing
if (_settingsWithDefaults.advanced[key] !== undefined) {
// @ts-expect-error ignore typing
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"winston-transport": "^4.9.0",
"ws": "^8.18.0",
"zigbee-herdsman": "3.0.0-pre.0",
"zigbee-herdsman-converters": "20.28.0",
"zigbee-herdsman-converters": "21.0.0-pre.0",
"zigbee2mqtt-frontend": "0.7.4"
},
"devDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e290057

Please sign in to comment.