ztalbot2000 / homebridge-cmd4

CMD4 Plugin for Homebridge - Supports ~All Accessory Types & now all Characteristics too
Apache License 2.0
149 stars 13 forks source link

[Bug] humidity sensor statusTampered chracteristic not cached corretly #131

Closed crbyxwpzfl closed 2 years ago

crbyxwpzfl commented 2 years ago

hi first of all as always I rally enjoy your plugin! and you helped me a lot really appreciate it! feel free to close / Ignore this Issue as this is not a major issue. thank you in advance!

Describe The Bug:

When I restart homebridge the error below occurs and homebridge does not start again. Until I clear the cache for the accessory HumiditySensor however. possibly related to "#130 linked tyes not cached"

To Reproduce:

Run homebridge with a cmd4 HumiditySensor polling "characteristic": "statusTampered"

Paste of Logs:

[5/15/2022, 2:35:05 PM] [Cmd4] Initializing Cmd4 platform...
[5/15/2022, 2:35:05 PM] [Cmd4] Cmd4Platform didFinishLaunching
[5/15/2022, 2:35:05 PM] [Cmd4] Restoring existing accessory from cache: ambilight
[5/15/2022, 2:35:06 PM] [Cmd4] Creating linked accessories for: ambilight
[5/15/2022, 2:35:06 PM] [Cmd4] Restoring existing accessory from cache: sensor
[5/15/2022, 2:35:06 PM] Error: Polling for: "statusTampered" requested, but characteristic is not in your config.json file for: "sensor".
    at /usr/local/lib/node_modules/homebridge-cmd4/Cmd4Accessory.js:496:28
    at Array.forEach (<anonymous>)
    at Cmd4Accessory.checkPollingConfigForUnsetCharacteristics (/usr/local/lib/node_modules/homebridge-cmd4/Cmd4Accessory.js:431:21)
    at new Cmd4Accessory (/usr/local/lib/node_modules/homebridge-cmd4/Cmd4Accessory.js:282:12)
    at /usr/local/lib/node_modules/homebridge-cmd4/Cmd4Platform.js:499:25
    at Array.forEach (<anonymous>)
    at Cmd4Platform.discoverDevices (/usr/local/lib/node_modules/homebridge-cmd4/Cmd4Platform.js:425:58)
    at HomebridgeAPI.<anonymous> (/usr/local/lib/node_modules/homebridge-cmd4/Cmd4Platform.js:121:15)
    at HomebridgeAPI.emit (node:events:532:35)
    at HomebridgeAPI.signalFinished (/usr/local/lib/node_modules/homebridge/src/api.ts:275:10)
[5/15/2022, 2:35:06 PM] Got SIGTERM, shutting down Homebridge...
[5/15/2022, 2:35:11 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[5/15/2022, 2:35:16 PM] [HB Supervisor] Restarting Homebridge...

Cmd4 Config:

{
                    "type": "HumiditySensor",
                    "displayName": "sensor",
                    "currentRelativeHumidity": 0,
                    "statusActive": "False",
                    "statusTampered": "NOT_TAMPERED",
                    "stateChangeResponseTime": 1,
                    "polling": [
                        {
                            "characteristic": "currentRelativeHumidity",
                            "interval": 10,
                            "timeout": 8000
                        },
                        {
                            "characteristic": "statusActive",
                            "interval": 10,
                            "timeout": 8000
                        },
                        {
                            "characteristic": "statusTampered",
                            "interval": 10,
                            "timeout": 8000
                        }
                    ],
                    "state_cmd": "python3 /Users/mini/Desktop/test.py"
                },
crbyxwpzfl commented 2 years ago

sorry forgot to update homebridge. issue gone on homebridge v1.4.1