Skip to content

Commit

Permalink
fix(server): handle device features with underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatloch committed Jun 4, 2024
1 parent c034266 commit ff79dc8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/server/src/bridges/zigbee/zigbeeDeviceManager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EOL } from 'node:os';

import { get, set } from 'lodash';
import { camelCase, get, set } from 'lodash';

import {
DeviceDeactivatedByType,
Expand Down Expand Up @@ -198,7 +198,7 @@ export const createZigbeeDeviceManager = (): ZigbeeDeviceManager => {

const createFeature = ({
type,
property,
property: orginalProperty,
description,
unit,
valueMax,
Expand All @@ -210,10 +210,12 @@ export const createZigbeeDeviceManager = (): ZigbeeDeviceManager => {
values,
}: ZigbeeDeviceFeature) => {
// special 'type'
if (!property) {
if (!orginalProperty) {
return;
}

const property = camelCase(orginalProperty);

const existingFeature = get(device?.features, property);

// user can update it themselves, don't overwrite it
Expand Down

0 comments on commit ff79dc8

Please sign in to comment.