roleoroleo / yi-hack_ha_integration

Home Assistant custom integration for Yi cameras: yi-hack-MStar, yi-hack-Allwinner, yi-hack-Allwinner-v2, yi-hack-v5 and sonoff-hack
GNU General Public License v3.0
205 stars 32 forks source link

Privacy switch enabled when media player gets deactivated #102

Closed aqwserf closed 2 months ago

aqwserf commented 1 year ago

Hi!

Moving forward on my automation, I noticed that when I deactivate the media player in HA, the privacy switch is automatically activated, with around a 20s delay:

image

Same behavior happens when I activate the media player, the privacy switch is set to off:

image

I've tested on both MStar and Allwinnerv2, same behavior.

FYI, MQTT is disabled on every camera as I use Frigate for motion detection, but I guess it has not impact as these 2 controls use API.

BTW, no matter if media player is on or off, I can play TTS using HA TTS service. Is there another purpose for this switch?

Thanks!

aqwserf commented 1 year ago

Hum, after reading the code, I guess why it's happening:

https://github.com/roleoroleo/yi-hack_ha_integration/blob/9910c442ff8023c5115edcc56f7836b8e0cff70e/custom_components/yi_hack/media_player.py#L151-L152

https://github.com/roleoroleo/yi-hack_ha_integration/blob/9910c442ff8023c5115edcc56f7836b8e0cff70e/custom_components/yi_hack/media_player.py#L166-L167

So my question is why? We should be able to turn on/off the media player without impacting privacy? Or again, I don't get the purpose of media player ^^

roleoroleo commented 1 year ago

You are right. By design, media_player switch and privacy switch have the same behavior. I should change media_player switch to disable tts (or media playing in generale) when it's switched off.

aqwserf commented 1 year ago

Ok, so if I understand correctly, privacy switch is impacted by media_player switch, and media_player switch has not impact right?

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.