-
-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Zigbee2mqtt: Add pilot wire mode (#2140)
- Loading branch information
1 parent
749cfe1
commit 35864b5
Showing
9 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
front/src/components/boxs/device-in-room/device-features/PilotWireModeDeviceFeature.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import get from 'get-value'; | ||
import { Text } from 'preact-i18n'; | ||
|
||
import { DeviceFeatureCategoriesIcon } from '../../../../utils/consts'; | ||
import { PILOT_WIRE_MODE } from '../../../../../../server/utils/constants'; | ||
|
||
const PilotWireModeDeviceFeature = ({ children, ...props }) => { | ||
const { deviceFeature } = props; | ||
const { category, type } = deviceFeature; | ||
|
||
function updateValue(e) { | ||
props.updateValueWithDebounce(deviceFeature, e.currentTarget.value); | ||
} | ||
|
||
return ( | ||
<tr> | ||
<td> | ||
<i class={`fe fe-${get(DeviceFeatureCategoriesIcon, `${category}.${type}`, { default: 'sliders' })}`} /> | ||
</td> | ||
<td>{props.rowName}</td> | ||
|
||
<td class="py-0"> | ||
<div class="justify-content-end"> | ||
<div class="form-group mb-0"> | ||
<select value={props.deviceFeature.last_value} onChange={updateValue} class="form-control form-control-sm"> | ||
<option value={PILOT_WIRE_MODE.OFF}> | ||
<Text id={`deviceFeatureAction.category.${category}.${type}.off`} /> | ||
</option> | ||
<option value={PILOT_WIRE_MODE.FROST_PROTECTION}> | ||
<Text id={`deviceFeatureAction.category.${category}.${type}.frost-protection`} /> | ||
</option> | ||
<option value={PILOT_WIRE_MODE.ECO}> | ||
<Text id={`deviceFeatureAction.category.${category}.${type}.eco`} /> | ||
</option> | ||
<option value={PILOT_WIRE_MODE.COMFORT_2}> | ||
<Text id={`deviceFeatureAction.category.${category}.${type}.comfort_-2`} /> | ||
</option> | ||
<option value={PILOT_WIRE_MODE.COMFORT_1}> | ||
<Text id={`deviceFeatureAction.category.${category}.${type}.comfort_-1`} /> | ||
</option> | ||
<option value={PILOT_WIRE_MODE.COMFORT}> | ||
<Text id={`deviceFeatureAction.category.${category}.${type}.comfort`} /> | ||
</option> | ||
</select> | ||
</div> | ||
</div> | ||
</td> | ||
</tr> | ||
); | ||
}; | ||
|
||
export default PilotWireModeDeviceFeature; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters