Home Assistant: remove attributes from discovered entities. https://github.com/Koenkk/zigbee2mqtt/discussions/7249

This commit is contained in:
Koen Kanters 2021-04-29 19:43:54 +02:00
parent d61d6e28f2
commit 54ab0a3f98
3 changed files with 0 additions and 27 deletions

View File

@ -654,8 +654,6 @@ class HomeAssistant extends Extension {
payload.tilt_status_topic = stateTopic;
}
payload.json_attributes_topic = stateTopic;
// Set (unique) name, separate by space if friendlyName contains space.
const nameSeparator = friendlyName.includes('_') ? '_' : ' ';
payload.name = friendlyName;

View File

@ -29,7 +29,6 @@ describe('Configure', () => {
expectBulbConfigured = () => {
const device = zigbeeHerdsman.devices.bulb;
const endpoint1 = device.getEndpoint(1);
console.log(endpoint1.read.mock.calls);
expect(endpoint1.read).toHaveBeenCalledTimes(2);
expect(endpoint1.read).toHaveBeenCalledWith('lightingColorCtrl', ['colorCapabilities']);
expect(endpoint1.read).toHaveBeenCalledWith('lightingColorCtrl', [ 'colorTempPhysicalMin', 'colorTempPhysicalMax' ]);
@ -38,7 +37,6 @@ describe('Configure', () => {
expectBulbNotConfigured = () => {
const device = zigbeeHerdsman.devices.bulb;
const endpoint1 = device.getEndpoint(1);
console.log(endpoint1.read.mock.calls);
expect(endpoint1.read).toHaveBeenCalledTimes(0);
}

View File

@ -56,7 +56,6 @@ describe('HomeAssistant extension', () => {
'device_class': 'temperature',
'value_template': '{{ value_json.temperature }}',
'state_topic': 'zigbee2mqtt/weather_sensor',
'json_attributes_topic': 'zigbee2mqtt/weather_sensor',
'name': 'weather_sensor_temperature',
'unique_id': '0x0017880104e45522_temperature_zigbee2mqtt',
'device': {
@ -81,7 +80,6 @@ describe('HomeAssistant extension', () => {
'device_class': 'humidity',
'value_template': '{{ value_json.humidity }}',
'state_topic': 'zigbee2mqtt/weather_sensor',
'json_attributes_topic': 'zigbee2mqtt/weather_sensor',
'name': 'weather_sensor_humidity',
'unique_id': '0x0017880104e45522_humidity_zigbee2mqtt',
'device': {
@ -106,7 +104,6 @@ describe('HomeAssistant extension', () => {
'device_class': 'pressure',
'value_template': '{{ value_json.pressure }}',
'state_topic': 'zigbee2mqtt/weather_sensor',
'json_attributes_topic': 'zigbee2mqtt/weather_sensor',
'name': 'weather_sensor_pressure',
'unique_id': '0x0017880104e45522_pressure_zigbee2mqtt',
'device': {
@ -131,7 +128,6 @@ describe('HomeAssistant extension', () => {
'device_class': 'battery',
'value_template': '{{ value_json.battery }}',
'state_topic': 'zigbee2mqtt/weather_sensor',
'json_attributes_topic': 'zigbee2mqtt/weather_sensor',
'name': 'weather_sensor_battery',
'unique_id': '0x0017880104e45522_battery_zigbee2mqtt',
'device': {
@ -156,7 +152,6 @@ describe('HomeAssistant extension', () => {
'unit_of_measurement': 'lqi',
'value_template': '{{ value_json.linkquality }}',
'state_topic': 'zigbee2mqtt/weather_sensor',
'json_attributes_topic': 'zigbee2mqtt/weather_sensor',
'name': 'weather_sensor_linkquality',
'unique_id': '0x0017880104e45522_linkquality_zigbee2mqtt',
'device': {
@ -192,7 +187,6 @@ describe('HomeAssistant extension', () => {
"name":"wall_switch_double",
"sw_version":this.version
},
"json_attributes_topic":"zigbee2mqtt/wall_switch_double",
"name":"wall_switch_double_left",
"payload_off":"OFF",
"payload_on":"ON",
@ -224,7 +218,6 @@ describe('HomeAssistant extension', () => {
"name":"wall_switch_double",
"sw_version":this.version
},
"json_attributes_topic":"zigbee2mqtt/wall_switch_double",
"name":"wall_switch_double_right",
"payload_off":"OFF",
"payload_on":"ON",
@ -271,7 +264,6 @@ describe('HomeAssistant extension', () => {
"finish_effect",
"stop_effect"
],
"json_attributes_topic":"zigbee2mqtt/bulb",
"name":"bulb",
"schema":"json",
"state_topic":"zigbee2mqtt/bulb",
@ -306,7 +298,6 @@ describe('HomeAssistant extension', () => {
'device_class': 'temperature',
'value_template': "{{ value_json.temperature }}",
'state_topic': 'zigbee2mqtt/weather_sensor',
'json_attributes_topic': 'zigbee2mqtt/weather_sensor',
'name': 'weather_sensor_temperature',
'unique_id': '0x0017880104e45522_temperature_zigbee2mqtt',
'device': {
@ -331,7 +322,6 @@ describe('HomeAssistant extension', () => {
'device_class': 'humidity',
'value_template': '{{ value_json.humidity }}',
'state_topic': 'zigbee2mqtt/weather_sensor',
'json_attributes_topic': 'zigbee2mqtt/weather_sensor',
'name': 'weather_sensor_humidity',
'unique_id': '0x0017880104e45522_humidity_zigbee2mqtt',
'device': {
@ -356,7 +346,6 @@ describe('HomeAssistant extension', () => {
'device_class': 'pressure',
'value_template': '{{ value_json.pressure }}',
'state_topic': 'zigbee2mqtt/weather_sensor',
'json_attributes_topic': 'zigbee2mqtt/weather_sensor',
'name': 'weather_sensor_pressure',
'unique_id': '0x0017880104e45522_pressure_zigbee2mqtt',
'device': {
@ -412,7 +401,6 @@ describe('HomeAssistant extension', () => {
'device_class': 'temperature',
'value_template': '{{ value_json.temperature }}',
'state_topic': 'zigbee2mqtt/weather_sensor',
'json_attributes_topic': 'zigbee2mqtt/weather_sensor',
'name': 'weather_sensor_temperature',
'unique_id': '0x0017880104e45522_temperature_zigbee2mqtt',
'device': {
@ -439,7 +427,6 @@ describe('HomeAssistant extension', () => {
'device_class': 'humidity',
'value_template': '{{ value_json.humidity }}',
'state_topic': 'zigbee2mqtt/weather_sensor',
'json_attributes_topic': 'zigbee2mqtt/weather_sensor',
'name': 'weather_sensor_humidity',
'device': {
'identifiers': ['zigbee2mqtt_0x0017880104e45522'],
@ -495,7 +482,6 @@ describe('HomeAssistant extension', () => {
"name": "my_switch",
"sw_version": this.version
},
"json_attributes_topic": "zigbee2mqtt/my_switch",
"name": "my_light_name_override",
"payload_off": "OFF",
"payload_on": "ON",
@ -571,7 +557,6 @@ describe('HomeAssistant extension', () => {
"auto",
"smart"
],
"json_attributes_topic":"zigbee2mqtt/fan",
"name":"fan",
"unique_id":"0x0017880104e45548_fan_zigbee2mqtt",
"device":{
@ -630,7 +615,6 @@ describe('HomeAssistant extension', () => {
],
"hold_state_template":"{{ value_json.preset }}",
"hold_state_topic":"zigbee2mqtt/TS0601_thermostat",
"json_attributes_topic":"zigbee2mqtt/TS0601_thermostat",
"max_temp":"35",
"min_temp":"5",
"mode_command_topic":"zigbee2mqtt/TS0601_thermostat/set/system_mode",
@ -669,7 +653,6 @@ describe('HomeAssistant extension', () => {
set_position_topic: 'zigbee2mqtt/smart vent/set',
set_position_template: '{ "position": {{ position }} }',
position_template: '{{ value_json.position }}',
json_attributes_topic: 'zigbee2mqtt/smart vent',
name: 'smart vent',
unique_id: '0x0017880104e45551_cover_zigbee2mqtt',
device:
@ -704,7 +687,6 @@ describe('HomeAssistant extension', () => {
'device_class': 'temperature',
'value_template': '{{ value_json.temperature }}',
'state_topic': 'zigbee2mqtt/weather_sensor',
'json_attributes_topic': 'zigbee2mqtt/weather_sensor',
'name': 'weather_sensor_temperature',
'unique_id': '0x0017880104e45522_temperature_zigbee2mqtt',
'device': {
@ -789,7 +771,6 @@ describe('HomeAssistant extension', () => {
'device_class': 'temperature',
'value_template': '{{ value_json.temperature }}',
'state_topic': 'zigbee2mqtt/weather_sensor',
'json_attributes_topic': 'zigbee2mqtt/weather_sensor',
'name': 'weather_sensor_temperature',
'unique_id': '0x0017880104e45522_temperature_zigbee2mqtt',
'device': {
@ -915,7 +896,6 @@ describe('HomeAssistant extension', () => {
'device_class': 'temperature',
'value_template': '{{ value_json.temperature }}',
'state_topic': 'zigbee2mqtt/weather_sensor',
'json_attributes_topic': 'zigbee2mqtt/weather_sensor',
'name': 'weather_sensor_temperature',
'unique_id': '0x0017880104e45522_temperature_zigbee2mqtt',
'device': {
@ -1001,7 +981,6 @@ describe('HomeAssistant extension', () => {
'device_class': 'temperature',
'value_template': '{{ value_json.temperature }}',
'state_topic': 'zigbee2mqtt/weather_sensor_renamed',
'json_attributes_topic': 'zigbee2mqtt/weather_sensor_renamed',
'name': 'weather_sensor_renamed_temperature',
'unique_id': '0x0017880104e45522_temperature_zigbee2mqtt',
'device': {
@ -1071,7 +1050,6 @@ describe('HomeAssistant extension', () => {
'device_class': 'temperature',
'value_template': '{{ value_json.temperature }}',
'state_topic': 'zigbee2mqtt/weather_sensor_renamed',
'json_attributes_topic': 'zigbee2mqtt/weather_sensor_renamed',
'name': 'weather_sensor_renamed_temperature',
'unique_id': '0x0017880104e45522_temperature_zigbee2mqtt',
'device': {
@ -1101,7 +1079,6 @@ describe('HomeAssistant extension', () => {
"payload_off":false,
"value_template":"{{ value_json.update_available}}",
"state_topic":"zigbee2mqtt/bulb",
"json_attributes_topic":"zigbee2mqtt/bulb",
"name":"bulb update available",
"unique_id":"0x000b57fffec6a5b2_update_available_zigbee2mqtt",
"device":{