kopiro / homebridge-tapo-camera

Homebridge plugin for TP-Link TAPO security cameras
ISC License
119 stars 10 forks source link

Privacy state is opposite to actual state #116

Closed Leonick closed 5 months ago

Leonick commented 5 months ago

Describe The Bug: The state of the "Privacy" accessory is opposite to the camera's privacy mode. When the privacy accessory is on the privacy mode is off.

According to the readme the privacy accessory used to be called eyes and it made sense that eyes on = privacy off. But it seems the default name changed but the states did not?

I renamed the accessory to Camera so the state makes sense, but the configured name isn't used in the log so confusingly log says "Setting privacy to on" when doing the opposite.

To Reproduce: Check state of privacy in homebride and in tapo app.

Expected behavior: The privacy accessory state should match the camera setting it controls, or it should be renamed to something more fitting.

Plugin Config:

{
    "cameras": [
        {
            "name": "Tapo C100",
            "ipAddress": "",
            "password": "",
            "streamUser": "",
            "streamPassword": "",
            "disableAlarmAccessory": true,
            "privacyAccessoryName": "Camera"
        }
    ],
    "platform": "tapo-camera"
}

Screenshots:

Environment:

kopiro commented 5 months ago

Hello; this is the reason why it's called "Eyes" - as like the camera can't see when its eyes are closed. This is the ensure that if you say "Switch camera off", the "eyes" goes off and privacy mode turns on.

kopiro commented 5 months ago

I'm sorry, I misread your bug. When you say "But it seems the default name changed but the states did not" what do you mean; perhaps you have set a custom name in the Homebridge UI, the default should still be Eyes.

Leonick commented 5 months ago

Yea, I've renamed it camera, I see that if I remove that the default name is indeed still eyes like the description. But it's weird how it is otherwise referred to as privacy throughout the the plugin.

The log calls it privacy no matter your configured name which is what I primarily reacted to.

"Eyes" accessory is turned on, log says privacy turned on, but in Tapo terms privacy was actually turned off.

image

So maybe use the configured accessory name in logs? Or just call it eyes everywhere instead of privacy, or add a toggle to flip behaviour?