homebridge-cmd4 7.0.2 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # Homebridges-cmd4 - CMD4 Plugin for Homebridge - Supports ~All Accessory Types and now all Characteristics too!!
2
- ### 7.0.2 (2023-12-24)
2
+ ### 7.1.0 (2024-03-04)
3
3
 
4
- ##### Change affecting AdvAir by their request
4
+ ##### Documentation Changes
5
5
 
6
- * For AdvAir.sh put accessory name in double quotes so it can contain a single quote ([023e91c0](https://github.com/ztalbot2000/homebridge-cmd4/commit/023e91c0bf1794a64bf0e18dec7d31b178ecb6d1))
6
+ * Update for newest characteristics ([fccb9ebd](https://github.com/ztalbot2000/homebridge-cmd4/commit/fccb9ebdc18a2cd876b1512e0da2d5d28e8019b0))
7
+
8
+ ##### New Features
9
+
10
+ * Add in latest new characteristics and devices ([545112f0](https://github.com/ztalbot2000/homebridge-cmd4/commit/545112f0fa2122abf51d3217707012879db723b7))
7
11
 
8
12
 
package/Cmd4Accessory.js CHANGED
@@ -811,17 +811,13 @@ class Cmd4Accessory
811
811
  let props = accessory.configHasCharacteristicProps( accTypeEnumIndex );
812
812
  if ( props )
813
813
  {
814
- //if ( settings.cmd4Dbg ) accessory.log.debug( "Overriding characteristic %s props for: %s ", CMD4_ACC_TYPE_ENUM.properties[ accTypeEnumIndex ].type, this.displayName );
815
- if ( settings.cmd4Dbg ) accessory.log.debug( "Overriding characteristic %s props for: %s ", uCCharacteristicString, this.displayName );
814
+ if ( settings.cmd4Dbg ) accessory.log.debug( "Overriding characteristic %s props for: %s ", CMD4_ACC_TYPE_ENUM.properties[ accTypeEnumIndex ].type, this.displayName );
816
815
  accessory.service.getCharacteristic( CMD4_ACC_TYPE_ENUM.properties[ accTypeEnumIndex ].
817
816
  characteristic )
818
817
  .setProps(
819
- {
820
- // minValue: 18,
821
- // maxValue: 30,
822
- // minStep: 1
823
- props
824
- });
818
+ // props is an object of name value pairs (characteristics)
819
+ props
820
+ );
825
821
  }
826
822
 
827
823
  // Get the permissions of characteristic ( Read/Write ... )
@@ -2059,6 +2059,191 @@ switch( io )
2059
2059
 
2060
2060
  break;
2061
2061
  }
2062
+ // New Mar 2024
2063
+ case "AccessCodeControlPoint": // 233
2064
+ {
2065
+ c = readData( device, characteristic );
2066
+
2067
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2068
+
2069
+ break;
2070
+ }
2071
+ case "AccessCodeSupportedConfiguration": // 234
2072
+ {
2073
+ c = readData( device, characteristic );
2074
+
2075
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2076
+
2077
+ break;
2078
+ }
2079
+ case "AirPlayEnable": // 235
2080
+ {
2081
+ c = readData( device, characteristic );
2082
+
2083
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2084
+
2085
+ break;
2086
+ }
2087
+ case "CharacteristicValueActiveTransitionCount": // 236
2088
+ {
2089
+ c = readData( device, characteristic );
2090
+
2091
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2092
+
2093
+ break;
2094
+ }
2095
+ case "CryptoHash": // 237
2096
+ {
2097
+ c = readData( device, characteristic );
2098
+
2099
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2100
+
2101
+ break;
2102
+ }
2103
+ case "FirmwareUpdateReadiness": // 238
2104
+ {
2105
+ c = readData( device, characteristic );
2106
+
2107
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2108
+
2109
+ break;
2110
+ }
2111
+ case "FirmwareUpdateStatus": // 239
2112
+ {
2113
+ c = readData( device, characteristic );
2114
+
2115
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2116
+
2117
+ break;
2118
+ }
2119
+ case "HardwareFinish": // 240
2120
+ {
2121
+ c = readData( device, characteristic );
2122
+
2123
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2124
+
2125
+ break;
2126
+ }
2127
+ case "MetricsBufferFullState": // 241
2128
+ {
2129
+ c = readData( device, characteristic );
2130
+
2131
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2132
+
2133
+ break;
2134
+ }
2135
+ case "MultifunctionButton": // 242
2136
+ {
2137
+ c = readData( device, characteristic );
2138
+
2139
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2140
+
2141
+ break;
2142
+ }
2143
+ case "NetworkAccessViolationControl": // 243
2144
+ {
2145
+ c = readData( device, characteristic );
2146
+
2147
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2148
+
2149
+ break;
2150
+ }
2151
+ case "SelectedDiagnosticsModes": // 244
2152
+ {
2153
+ c = readData( device, characteristic );
2154
+
2155
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2156
+
2157
+ break;
2158
+ }
2159
+ case "SelectedSleepConfiguration": // 245
2160
+ {
2161
+ c = readData( device, characteristic );
2162
+
2163
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2164
+
2165
+ break;
2166
+ }
2167
+ case "SiriEnable": // 246
2168
+ {
2169
+ c = readData( device, characteristic );
2170
+
2171
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2172
+
2173
+ break;
2174
+ }
2175
+ case "SiriEngineVersion": // 247
2176
+ {
2177
+ c = readData( device, characteristic );
2178
+
2179
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2180
+
2181
+ break;
2182
+ }
2183
+ case "SiriLightOnUse": // 248
2184
+ {
2185
+ c = readData( device, characteristic );
2186
+
2187
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2188
+
2189
+ break;
2190
+ }
2191
+ case "SiriListening": // 249
2192
+ {
2193
+ c = readData( device, characteristic );
2194
+
2195
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2196
+
2197
+ break;
2198
+ }
2199
+ case "SiriTouchToUse": // 250
2200
+ {
2201
+ c = readData( device, characteristic );
2202
+
2203
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2204
+
2205
+ break;
2206
+ }
2207
+ case "StagedFirmwareVersion": // 251
2208
+ {
2209
+ c = readData( device, characteristic );
2210
+
2211
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2212
+
2213
+ break;
2214
+ }
2215
+ case "SupportedMetrics": // 252
2216
+ {
2217
+ c = readData( device, characteristic );
2218
+
2219
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2220
+
2221
+ break;
2222
+ }
2223
+ case "SupportedFirmwareUpdateConfiguration": // 253
2224
+ {
2225
+ c = readData( device, characteristic );
2226
+
2227
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2228
+
2229
+ break;
2230
+ }
2231
+ case "TapType": // 254
2232
+ {
2233
+ c = readData( device, characteristic );
2234
+
2235
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2236
+
2237
+ break;
2238
+ }
2239
+ case "Token": // 255
2240
+ {
2241
+ c = readData( device, characteristic );
2242
+
2243
+ if ( c == "" ) process.stdout.write( "0" ); else process.stdout.write( `"${ c }"` );
2244
+
2245
+ break;
2246
+ }
2062
2247
  default:
2063
2248
  process.stderr.write( `Unknown Characteristic for: ${ io } Device: ${ device } Characteristic: ${ characteristic }` );
2064
2249
  process.exit( -1 );
@@ -3666,6 +3851,191 @@ switch( io )
3666
3851
 
3667
3852
  break;
3668
3853
  }
3854
+ // New Mar 2024
3855
+ case "AccessCodeControlPoint": // 233
3856
+ {
3857
+ c = readData( device, characteristic );
3858
+
3859
+ writeData( device, characteristic, option );
3860
+
3861
+ break;
3862
+ }
3863
+ case "AccessCodeSupportedConfiguration": // 234
3864
+ {
3865
+ c = readData( device, characteristic );
3866
+
3867
+ writeData( device, characteristic, option );
3868
+
3869
+ break;
3870
+ }
3871
+ case "AirPlayEnable": // 235
3872
+ {
3873
+ c = readData( device, characteristic );
3874
+
3875
+ writeData( device, characteristic, option );
3876
+
3877
+ break;
3878
+ }
3879
+ case "CharacteristicValueActiveTransitionCount": // 236
3880
+ {
3881
+ c = readData( device, characteristic );
3882
+
3883
+ writeData( device, characteristic, option );
3884
+
3885
+ break;
3886
+ }
3887
+ case "CryptoHash": // 237
3888
+ {
3889
+ c = readData( device, characteristic );
3890
+
3891
+ writeData( device, characteristic, option );
3892
+
3893
+ break;
3894
+ }
3895
+ case "FirmwareUpdateReadiness": // 238
3896
+ {
3897
+ c = readData( device, characteristic );
3898
+
3899
+ writeData( device, characteristic, option );
3900
+
3901
+ break;
3902
+ }
3903
+ case "FirmwareUpdateStatus": // 239
3904
+ {
3905
+ c = readData( device, characteristic );
3906
+
3907
+ writeData( device, characteristic, option );
3908
+
3909
+ break;
3910
+ }
3911
+ case "HardwareFinish": // 240
3912
+ {
3913
+ c = readData( device, characteristic );
3914
+
3915
+ writeData( device, characteristic, option );
3916
+
3917
+ break;
3918
+ }
3919
+ case "MetricsBufferFullState": // 241
3920
+ {
3921
+ c = readData( device, characteristic );
3922
+
3923
+ writeData( device, characteristic, option );
3924
+
3925
+ break;
3926
+ }
3927
+ case "MultifunctionButton": // 242
3928
+ {
3929
+ c = readData( device, characteristic );
3930
+
3931
+ writeData( device, characteristic, option );
3932
+
3933
+ break;
3934
+ }
3935
+ case "NetworkAccessViolationControl": // 243
3936
+ {
3937
+ c = readData( device, characteristic );
3938
+
3939
+ writeData( device, characteristic, option );
3940
+
3941
+ break;
3942
+ }
3943
+ case "SelectedDiagnosticsModes": // 244
3944
+ {
3945
+ c = readData( device, characteristic );
3946
+
3947
+ writeData( device, characteristic, option );
3948
+
3949
+ break;
3950
+ }
3951
+ case "SelectedSleepConfiguration": // 245
3952
+ {
3953
+ c = readData( device, characteristic );
3954
+
3955
+ writeData( device, characteristic, option );
3956
+
3957
+ break;
3958
+ }
3959
+ case "SiriEnable": // 246
3960
+ {
3961
+ c = readData( device, characteristic );
3962
+
3963
+ writeData( device, characteristic, option );
3964
+
3965
+ break;
3966
+ }
3967
+ case "SiriEngineVersion": // 247
3968
+ {
3969
+ c = readData( device, characteristic );
3970
+
3971
+ writeData( device, characteristic, option );
3972
+
3973
+ break;
3974
+ }
3975
+ case "SiriLightOnUse": // 248
3976
+ {
3977
+ c = readData( device, characteristic );
3978
+
3979
+ writeData( device, characteristic, option );
3980
+
3981
+ break;
3982
+ }
3983
+ case "SiriListening": // 249
3984
+ {
3985
+ c = readData( device, characteristic );
3986
+
3987
+ writeData( device, characteristic, option );
3988
+
3989
+ break;
3990
+ }
3991
+ case "SiriTouchToUse": // 250
3992
+ {
3993
+ c = readData( device, characteristic );
3994
+
3995
+ writeData( device, characteristic, option );
3996
+
3997
+ break;
3998
+ }
3999
+ case "StagedFirmwareVersion": // 251
4000
+ {
4001
+ c = readData( device, characteristic );
4002
+
4003
+ writeData( device, characteristic, option );
4004
+
4005
+ break;
4006
+ }
4007
+ case "SupportedMetrics": // 252
4008
+ {
4009
+ c = readData( device, characteristic );
4010
+
4011
+ writeData( device, characteristic, option );
4012
+
4013
+ break;
4014
+ }
4015
+ case "SupportedFirmwareUpdateConfiguration": // 253
4016
+ {
4017
+ c = readData( device, characteristic );
4018
+
4019
+ writeData( device, characteristic, option );
4020
+
4021
+ break;
4022
+ }
4023
+ case "TapType": // 254
4024
+ {
4025
+ c = readData( device, characteristic );
4026
+
4027
+ writeData( device, characteristic, option );
4028
+
4029
+ break;
4030
+ }
4031
+ case "Token": // 255
4032
+ {
4033
+ c = readData( device, characteristic );
4034
+
4035
+ writeData( device, characteristic, option );
4036
+
4037
+ break;
4038
+ }
3669
4039
  default:
3670
4040
  process.stderr.write( `Unknown Characteristic for: ${ io } Device:${ device } Characteristic:${ characteristic }` );
3671
4041
  process.exit( -1 );
@@ -463,8 +463,8 @@
463
463
  "stateChangeResponseTime": 3
464
464
  },
465
465
  {
466
- "type": "Slat",
467
- "displayName": "MySlat",
466
+ "type": "Slats",
467
+ "displayName": "MySlats",
468
468
  "slatType": "HORIZONTAL",
469
469
  "currentSlatState": "FIXED",
470
470
  "name": "MySlat",
@@ -1266,8 +1266,8 @@
1266
1266
  //"state_cmd": "node .homebridge/< yourScriptHere >"
1267
1267
  },
1268
1268
  {
1269
- "type": "Slat",
1270
- "displayName": "MySlat", // Not a characteristic, but a function parameter
1269
+ "type": "Slats",
1270
+ "displayName": "MySlats", // Not a characteristic, but a function parameter
1271
1271
 
1272
1272
  // Required Characteristics
1273
1273
  "slatType": "HORIZONTAL", // 0 - "HORIZONTAL"
package/README.md CHANGED
@@ -55,7 +55,7 @@
55
55
 
56
56
  &nbsp;&nbsp;&nbsp; Cmd4 supports Fakegato History and retaining previous state over restarts.
57
57
 
58
- &nbsp;&nbsp;&nbsp; Cmd4 Version 2.0 supported linked Accessories and the latest 3.0 Version supports both Platform plugin and Accessory plugin configurations as documented on [developers.homebridge.io](https://developers.homebridge.io).
58
+ &nbsp;&nbsp;&nbsp; Since version 2.0 Cmd4 has supported linked Accessories and the latest 3.0 Version supports both Platform plugin and Accessory plugin configurations as documented on [developers.homebridge.io](https://developers.homebridge.io).
59
59
 
60
60
  &nbsp;&nbsp;&nbsp; Cmd4 Version 3.5 adds in support for Custom Characteristics.
61
61
 
@@ -158,12 +158,7 @@ Note: For Homebridge-config-ui-x, you only need to write Cmd4 in the Environment
158
158
 
159
159
  <BR><BR>
160
160
  ## Todo
161
- * [X] Linked characteristics, i.e. a smoke detectors battery is not yet linked.
162
- * [X] Support for custom characteristics for an accessory. *Warning, May Not possible to be displayed by any GUI*
163
- * [X] Support multi word device names. (Technically done, but scripting is hard for newbies).
164
- * [ ] Scripting language to avoid creating new Homebridge modules.
165
- * [ ] HTTP commands. *Might be just to many options*
166
- * [ ] Become Homebridge Certified. ( The schema file would be very difficult )
161
+ * [ ] Become Homebridge Certified. ( The schema file for Homebridg-ui would be very difficult )
167
162
 
168
163
  <BR><BR>
169
164
  ## Contributing
@@ -4,6 +4,8 @@
4
4
 
5
5
 
6
6
  ## ChangeLog
7
+ * <a href="#Whats-new-in-7-1-0">**Whats new in 7.1.0**</a>
8
+ * <a href="#Whats-new-in-7-0-3">**Whats new in 7.0.3**</a>
7
9
  * <a href="#Whats-new-in-7-0-2">**Whats new in 7.0.2**</a>
8
10
  <a name="Whats-new-in-7-0-1">## Whats new in 7.0.0</a>
9
11
  #### 7.0.0 (2023-06-11)
@@ -89,6 +91,26 @@
89
91
  * <a href="#Whats-new-in-2-1">**Whats new in 2.1**</a>
90
92
  * <a href="#Whats-new-in-2-0">**Whats new in 2.0**</a>
91
93
 
94
+ <a name="Whats-new-in-7-1-0">## Whats new in 7.1.0</a>
95
+ ### 7.1.0 (2024-03-04)
96
+
97
+ ##### Documentation Changes
98
+
99
+ * Update for newest characteristics ([fccb9ebd](https://github.com/ztalbot2000/homebridge-cmd4/commit/fccb9ebdc18a2cd876b1512e0da2d5d28e8019b0))
100
+
101
+ ##### New Features
102
+
103
+ * Add in latest new characteristics and devices ([545112f0](https://github.com/ztalbot2000/homebridge-cmd4/commit/545112f0fa2122abf51d3217707012879db723b7))
104
+
105
+
106
+ <a name="Whats-new-in-7-0-3">## Whats new in 7.0.3</a>
107
+ #### 7.0.3 (2024-01-27)
108
+
109
+ ##### Bug Fixes
110
+
111
+ * props is already an object. Also test setProps is called for more than one characteristic. Affects only those who change a characteristics property range ([276d0c0d](https://github.com/ztalbot2000/homebridge-cmd4/commit/276d0c0d58b435c59fb3c1fdfd322f55f6b24434))
112
+
113
+
92
114
  <a name="Whats-new-in-7-1-0">## Whats new in 7.0.2</a>
93
115
  ### 7.0.2 (2023-12-24)
94
116
 
@@ -154,6 +154,8 @@ See the [Cmd4 Developers Guide](https://github.com/ztalbot2000/homebridge-cmd4/b
154
154
 
155
155
  ## Standard Accessories
156
156
  &nbsp;&nbsp;&nbsp;A Standard Accessory does not need a Platform. The Homebridge example given is. [Homebridge Switch](https://developers.homebridge.io/#/api/accessory-plugins). Cmd4 Version 3 can recreate the exact same configuration as:
157
+ <BR>
158
+ For upcoming Cmd4 version 8.0 this will no longer be supported. This is because of <a href="https://developers.homebridge.io/#/">Homebridge deprecated templates</a>.This will also make homebridge-ui easier to implement.
157
159
 
158
160
  ```json
159
161
  {
@@ -382,6 +384,43 @@ Example 2:
382
384
  ### Step 4. Sending constants to your script.
383
385
  &nbsp;&nbsp;&nbsp; By placing in your config.json file the tag "outputConstants": true, instead of values, your script will receive constants instead of values (Where Applicable). Homebridge-Cmd4 will except constants or values as input. See the config.min.json file for the defined constants.
384
386
 
387
+ ### Step 5. Changing characteristic properties.
388
+ &nbsp;&nbsp;&nbsp; Cmd4 will allow you to change a characteristics property range, However the HomeKit GUI will most likely ignore it. The change is for those who create their own GUI's. For Example:
389
+ ```json
390
+ "platforms": [
391
+ {
392
+ "platform": "Cmd4",
393
+ "debug": false,
394
+ "outputConstants": false,
395
+ "timeout": 4000,
396
+ "stateChangeResponseTime": 3,
397
+ "accessories": [
398
+ {
399
+ "type": "Thermostat",
400
+ "displayName": "MyThermostat",
401
+ "name": "MyThermostat",
402
+ "currentTemperature": 25,
403
+ "targetTemperature": 25,
404
+ "props": {
405
+ "currentTemperature": {
406
+ "maxValue": 32,
407
+ "minValue": 16,
408
+ "minStep": 1
409
+ },
410
+ "targetTemperature": {
411
+ "maxValue": 32,
412
+ "minValue": 16,
413
+ "minStep": 1
414
+ }
415
+ }
416
+ }
417
+ ]
418
+ }
419
+ ]
420
+ }
421
+ ```
422
+
423
+
385
424
  ***Important***
386
425
  &nbsp;&nbsp;&nbsp; Homebridge-cmd4 just outputs the value to be set. For whatever reason the lower layers of homebridge set on/off to be "true" and "false" instead of 0 & 1, which is incorrect, but changing it would break others scripts.
387
426
  &nbsp;&nbsp;&nbsp; Homebridge-cmd4 has always recognized either 0/1 or true/false when receiving the devices value.
@@ -431,7 +470,7 @@ The value "0" should be used for any characteristics value which is not possible
431
470
  ```
432
471
 
433
472
  ## Unit Testing
434
- &nbsp;&nbsp;&nbsp; Unit testing is done using the Mocha framework for Javascript and was introduced in homebridge-cmd4 version 2.1.2. There are 2796 test cases and they all run successfully. They test the homebridge-Cmd4 module to make sure that all characteristics, services and names are correct. The provided config.json is also tested for proper definitions of all the homebridge-cmd4 config parameters.
473
+ &nbsp;&nbsp;&nbsp; Unit testing is done using the Mocha framework for Javascript and was introduced in homebridge-cmd4 version 2.1.2. There are 11708 test cases and they all run successfully. They test the homebridge-Cmd4 module to make sure that all characteristics, services and names are correct. The provided config.json is also tested for proper definitions of all the homebridge-cmd4 config parameters.
435
474
 
436
475
  &nbsp;&nbsp;&nbsp; Unit testing is only possible in a development environment and can be achieved in the following manner.
437
476