Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: Remove deprecated Home Assistant integration features #24494

Merged
merged 10 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
248 changes: 47 additions & 201 deletions lib/extension/homeassistant.ts

Large diffs are not rendered by default.

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.8.0",
"ws": "^8.18.0",
"zigbee-herdsman": "3.0.0-pre.0",
"zigbee-herdsman-converters": "20.39.2",
"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.

2 changes: 0 additions & 2 deletions test/extensions/frontend.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ describe('Extension: Frontend', () => {
state: 'ON',
power_on_behavior: null,
linkquality: null,
update_available: null,
update: {state: null, installed_version: -1, latest_version: -1},
}),
{retain: false, qos: 0},
Expand All @@ -265,7 +264,6 @@ describe('Extension: Frontend', () => {
state: 'ON',
power_on_behavior: null,
linkquality: null,
update_available: null,
update: {state: null, installed_version: -1, latest_version: -1},
},
}),
Expand Down
Loading