Skip to content
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
1 change: 1 addition & 0 deletions lib/extension/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ export default class Bridge extends Extension {
}

const payload: Zigbee2MQTTDevice["definition"] = {
source: device.definition.externalConverterName ? "external" : device.definition.generated ? "generated" : "native",
model: device.definition.model,
vendor: device.definition.vendor,
description: device.definition.description,
Expand Down
1 change: 1 addition & 0 deletions lib/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export interface Zigbee2MQTTDeviceEndpointConfiguredReporting {
}

export interface Zigbee2MQTTDeviceDefinition {
source: "native" | "generated" | "external";
model: string;
vendor: string;
description: string;
Expand Down
11 changes: 11 additions & 0 deletions test/extensions/bridge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ describe("Extension: Bridge", () => {
},
{
definition: {
source: "native",
description: "TRADFRI bulb E26/E27, white spectrum, globe, opal, 980 lm",
exposes: [
{
Expand Down Expand Up @@ -625,6 +626,7 @@ describe("Extension: Bridge", () => {
{
date_code: "2019.09",
definition: {
source: "native",
description: "Hue Go",
exposes: [
{
Expand Down Expand Up @@ -820,6 +822,7 @@ describe("Extension: Bridge", () => {
},
{
definition: {
source: "native",
description: "Hue dimmer switch",
exposes: [
{
Expand Down Expand Up @@ -956,6 +959,7 @@ describe("Extension: Bridge", () => {
},
{
definition: {
source: "generated",
description: "Automatically generated definition",
exposes: [
{
Expand Down Expand Up @@ -1050,6 +1054,7 @@ describe("Extension: Bridge", () => {
},
{
definition: {
source: "native",
description: "Wireless mini switch",
exposes: [
{
Expand Down Expand Up @@ -1160,6 +1165,7 @@ describe("Extension: Bridge", () => {
},
{
definition: {
source: "native",
description: "Temperature and humidity sensor",
exposes: [
{
Expand Down Expand Up @@ -1302,6 +1308,7 @@ describe("Extension: Bridge", () => {
},
{
definition: {
source: "native",
description: "Mi smart plug",
exposes: [
{
Expand Down Expand Up @@ -1449,6 +1456,7 @@ describe("Extension: Bridge", () => {
},
{
definition: {
source: "native",
description: "zigfred plus smart in-wall switch",
exposes: [
{
Expand Down Expand Up @@ -1957,6 +1965,7 @@ describe("Extension: Bridge", () => {
},
{
definition: {
source: "native",
description: "TRADFRI bulb E26/E27, white spectrum, globe, opal, 980 lm",
exposes: [
{
Expand Down Expand Up @@ -2391,6 +2400,7 @@ describe("Extension: Bridge", () => {
stringify({
data: {
definition: {
source: "native",
description: "TRADFRI bulb E26/E27, white spectrum, globe, opal, 980 lm",
exposes: [
{
Expand Down Expand Up @@ -2626,6 +2636,7 @@ describe("Extension: Bridge", () => {
stringify({
data: {
definition: {
source: "generated",
description: "Automatically generated definition",
exposes: [
{
Expand Down
Loading