From 0025254f985e92ada9cee3d20a7e316e0f4a61be Mon Sep 17 00:00:00 2001 From: atrovato <1839717+atrovato@users.noreply.github.com> Date: Wed, 19 Aug 2020 15:35:51 +0200 Subject: [PATCH] MQTT service: In the "devices in rooms" dashboard box, display the feature name of a binary device, not the device name Fixes #787 --- .../device-features/BinaryDeviceFeature.jsx | 4 +- .../device-in-room/device-features/utils.js | 12 ++++++ front/src/config/demo.json | 40 +++++++++++++++++-- server/lib/room/room.getBySelector.js | 18 ++++++--- server/test/controllers/room/room.test.js | 12 ++++++ 5 files changed, 77 insertions(+), 9 deletions(-) create mode 100644 front/src/components/boxs/device-in-room/device-features/utils.js diff --git a/front/src/components/boxs/device-in-room/device-features/BinaryDeviceFeature.jsx b/front/src/components/boxs/device-in-room/device-features/BinaryDeviceFeature.jsx index 1b3ccf06ab..ce8c28e02c 100644 --- a/front/src/components/boxs/device-in-room/device-features/BinaryDeviceFeature.jsx +++ b/front/src/components/boxs/device-in-room/device-features/BinaryDeviceFeature.jsx @@ -1,3 +1,5 @@ +import { getDeviceName } from './utils'; + const BinaryDeviceType = ({ children, ...props }) => { function updateValue() { props.updateValue( @@ -16,7 +18,7 @@ const BinaryDeviceType = ({ children, ...props }) => { - {props.device.name} + {getDeviceName(props.device, props.deviceFeature)}