Skip to content

Commit

Permalink
* (bluefox) Working on the controller
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Nov 16, 2023
1 parent f6fb5cd commit 422f7c4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
- fake delete (so the real deletion will be done in backend with factory reset of device)

## Changelog
### **WORK IN PROGRESS**
* (bluefox) Working on the controller

### 0.1.10 (2023-11-13)
* (bluefox) Implemented the factory reset and re-announcing

Expand Down
13 changes: 7 additions & 6 deletions src-admin/src/Tabs/Bridges.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export class Bridges extends BridgesAndDevices {
enabled: true,
noComposed: true,
auto: isAutoDetected,
actionAllowedByIdentify: false,
};
if (device.type === 'dimmer') {
obj.hasOnState = device.hasOnState;
Expand Down Expand Up @@ -297,7 +298,7 @@ export class Bridges extends BridgesAndDevices {

if (device.type === 'dimmer') {
device.dimmerUseLastLevelForOn = this.state.editDeviceDialog.dimmerUseLastLevelForOn;
if (device.dimmerUseLastLevelForOn) {
if (!device.dimmerUseLastLevelForOn) {
device.dimmerOnLevel = this.state.editDeviceDialog.dimmerOnLevel;
}
}
Expand Down Expand Up @@ -373,10 +374,10 @@ export class Bridges extends BridgesAndDevices {
</Select>
</FormControl>
<FormControlLabel
style={{ marginTop: 20 }}
style={{ width: '100%', marginTop: 30 }}
label={I18n.t('Allow action by identify')}
control={<Checkbox
checked={!!this.state.editDeviceDialog.actionAllowedByIdentify}
checked={this.state.editDeviceDialog.actionAllowedByIdentify}
onChange={e => {
const editDeviceDialog = JSON.parse(JSON.stringify(this.state.editDeviceDialog));
editDeviceDialog.actionAllowedByIdentify = e.target.checked;
Expand All @@ -389,7 +390,7 @@ export class Bridges extends BridgesAndDevices {
style={{ marginTop: 20 }}
label={I18n.t('Use last value for ON')}
control={<Checkbox
checked={!!this.state.editDeviceDialog.dimmerUseLastLevelForOn}
checked={this.state.editDeviceDialog.dimmerUseLastLevelForOn}
onChange={e => {
const editDeviceDialog = JSON.parse(JSON.stringify(this.state.editDeviceDialog));
editDeviceDialog.dimmerUseLastLevelForOn = e.target.checked;
Expand Down Expand Up @@ -421,15 +422,15 @@ export class Bridges extends BridgesAndDevices {
{isCommissioned ? I18n.t('Bridge is already commissioned. You cannot change the name or the vendor/product ID.') : null}
</DialogContent>
<DialogActions>
{!isCommissioned ? <Button
<Button
onClick={() => save()}
startIcon={<Save />}
disabled={isDisabled}
color="primary"
variant="contained"
>
{I18n.t('Apply')}
</Button> : null}
</Button>
<Button
onClick={() => this.setState({ editDeviceDialog: false })}
startIcon={<Close />}
Expand Down
3 changes: 2 additions & 1 deletion src-admin/src/Tabs/Devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class Devices extends BridgesAndDevices {
</Select>
</FormControl>
<FormControlLabel
style={{ marginTop: 20 }}
style={{ width: '100%', marginTop: 30 }}
label={I18n.t('Allow action by identify')}
control={<Checkbox
checked={!!this.state.editDeviceDialog.actionAllowedByIdentify}
Expand Down Expand Up @@ -351,6 +351,7 @@ class Devices extends BridgesAndDevices {
vendorID: device.vendorID,
noComposed: true,
enabled: true,
actionAllowedByIdentify: false,
};
if (device.type === 'dimmer') {
obj.hasOnState = device.hasOnState;
Expand Down

0 comments on commit 422f7c4

Please sign in to comment.