Skip to content

Commit

Permalink
Translate titles (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
sikmir authored Jun 4, 2024
1 parent f0f7b26 commit 307f33d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
wb-zigbee2mqtt (1.3.5) stable; urgency=medium

* Translate titles

-- Nikolay Korotkiy <nikolay.korotkiy@wirenboard.com> Mon, 03 Jun 2024 10:00:00 +0400

wb-zigbee2mqtt (1.3.4) stable; urgency=medium

* Avoid duplicated rules creation
Expand Down
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ Source: wb-zigbee2mqtt
Maintainer: Ian Ianin <ianin@wirenboard.ru>
Section: misc
Priority: optional
Standards-Version: 1.0.0
Standards-Version: 3.9.4
Build-Depends: debhelper (>= 9), pkg-config
Homepage: https://github.com/wirenboard/wb-zigbee2mqtt

Package: wb-zigbee2mqtt
Architecture: all
Depends: ${misc:Depends}, wb-rules (>= 2.6.0)
Depends: ${misc:Depends}, wb-rules (>= 2.20.0~~)
Description: zigbee2mqtt to Wiren Board MQTT Conventions bridge
14 changes: 10 additions & 4 deletions wb-zigbee2mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,34 @@ var controlsTypes = {
};

defineVirtualDevice('zigbee2mqtt', {
title: 'Zigbee2mqtt',
title: { en: 'Zigbee2mqtt converter', ru: 'Zigbee2mqtt конвертер' },
cells: {
State: {
title: { en: 'State', ru: 'Состояние' },
type: 'text',
value: '',
},
'Permit join': {
title: { en: 'Permit join', ru: 'Разрешить сопряжение' },
type: 'switch',
value: false,
},
'Update devices': {
title: { en: 'Update devices', ru: 'Обновить устройства' },
type: 'pushbutton',
},
Version: {
title: { en: 'Version', ru: 'Версия' },
type: 'text',
value: '',
},
'Log level': {
title: { en: 'Log level', ru: 'Уровень логирования' },
type: 'text',
value: '',
},
Log: {
title: { en: 'Log', ru: 'Лог' },
type: 'text',
value: '',
},
Expand Down Expand Up @@ -135,7 +141,7 @@ function getControlType(controlName, controlsTypes) {
return controlName in controlsTypes ? controlsTypes[controlName] : 'text';
}

function getContolValue(contolName, controlValue, controlsTypes) {
function getControlValue(contolName, controlValue, controlsTypes) {
if (contolName in controlsTypes) return controlValue;
if (controlValue == null) return '';
if (typeof controlValue === 'object') {
Expand All @@ -155,11 +161,11 @@ function initTracker(deviceName) {
if (!getDevice(deviceName).isControlExists(controlName)) {
getDevice(deviceName).addControl(controlName, {
type: getControlType(controlName, controlsTypes),
value: getContolValue(controlName, device[controlName], controlsTypes),
value: getControlValue(controlName, device[controlName], controlsTypes),
readonly: true,
});
} else {
dev[deviceName][controlName] = getContolValue(
dev[deviceName][controlName] = getControlValue(
controlName,
device[controlName],
controlsTypes
Expand Down

0 comments on commit 307f33d

Please sign in to comment.