Skip to content

Commit

Permalink
Fix for target keypads feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kuestess committed Sep 20, 2023
1 parent e1ca6b3 commit 12e3d8d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog

All notable changes to this project will be documented in this file.
## [0.5.11] - 2023-09-19
### Fixed
- Fix for target keypads feature (#300)

## [0.5.10] - 2023-07-29
### Enhanced
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Devices are also defined in the config.json as follows:
- `targetKeypadID`: this is an array `["<Insteon ID>","<Insteon ID>"]` of Insteon keypad(s), whose scene button LED you would like to set accoridngly to the state of the device. See additional notes below on Target Keypad LED.
- `targetKeypadBtn`: this is an array `["button_letter","button_letter"]` of Insteon keypad button(s), 'A' - 'H', that corresponds to the array from `targetKeypadID`. See additional notes below on Target Keypad LED.
- `targetKeypadSixBtn`: this is an array `[true/false, true/false]` of Insteon keypad button layout, that corresponds to the array from `targetKeypadID`. `true` denote a 6-button keypad, while `false` denotes an 8-button keypad. See additional notes below on Target Keypad LED.
- `targetKeypadFourBtn`: similar to `targetKeypadSixBtn` above but for a 4-button (i3) keypad. `true` denotes a 4-button keypad, while `false` denotes an 8-button keypad. See additional notes below on Target Keypad LED.
- `disabled`: set to true to disable Insteon communication for a device (defaults to false). Device will still appear in Home (or other apps), but can't be controlled. Good to use for 'seasonal' devices.
- `groupMembers`: comma-delimited list of Insteon IDs that are linked to this device (optional, for devices with on/off states like dimmers and switches); member device status will be automatically updated after the device is turned on or off

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": false,
"displayName": "InsteonLocal",
"name": "homebridge-platform-insteonlocal",
"version": "0.5.10",
"version": "0.5.11",
"description": "Insteon platform plugin with local control for homebridge: https://github.com/nfarina/homebridge",
"license": "ISC",
"repository": {
Expand Down
11 changes: 8 additions & 3 deletions src/InsteonLocalAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class InsteonLocalAccessory {
currentTemp: any;
targetTemp: any;
refresh: number;
targetKeypadFourBtn: any;

constructor(
private readonly platform: InsteonLocalPlatform,
Expand All @@ -89,6 +90,7 @@ export class InsteonLocalAccessory {

this.targetKeypadID = this.device.targetKeypadID || [];
this.targetKeypadSixBtn = this.device.targetKeypadSixBtn || [];
this.targetKeypadFourBtn = this.device.targetKeypadFourBtn || [];
this.targetKeypadBtn = this.device.targetKeypadBtn || [];
this.setTargetKeypadCount = 0;

Expand Down Expand Up @@ -1402,12 +1404,15 @@ export class InsteonLocalAccessory {

//this.log.debug('<Check point 4> index1 = ' + index1)

if(this.six_btn == true){
if(this.targetKeypadSixBtn[index1] == true){
buttonArray = six_buttonArray;
} else if (this.four_btn == true){
this.log.debug(' Using 6-button keypad layout');
} else if(this.targetKeypadFourBtn[index1] == true){
buttonArray = four_buttonArray;
} else {
this.log.debug(' Using 4-button keypad layout');
}else {
buttonArray = eight_buttonArray;
this.log.debug(' Using 8-button keypad layout');
}

const buttonNumber = buttonArray[this.targetKeypadBtn[index1]];
Expand Down

0 comments on commit 12e3d8d

Please sign in to comment.