JurajNyiri / HomeAssistant-Tapo-Control

Control for Tapo cameras as a Home Assistant component
Apache License 2.0
968 stars 81 forks source link

patrol_mode shows as unknown instead of off #444

Closed codyc1515 closed 8 months ago

codyc1515 commented 8 months ago

Description

2023-11-08 09_08_25-Clipboard 2023-11-08 09_11_00-Clipboard

Reproduction Steps

I think this became an issue in the most recent release.

Expected behavior

Should default to off instead of unknown.

If applicable, add error logs.

No response

Device Firmware

1.3.6 Build 230424 Rel.77225n(4555)

Integration Version

5.4.2

Using stream component

Yes

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

OS

Search for similar issues

Yes

Additional information

access_token: xxx
model_name: C200
brand: TP-Link
motion_detection: on
frontend_stream_type: hls
device_type: SMART.IPCAMERA
device_model: C200
device_name: C200 1.0
device_info: C200 1.0 IPC
hw_version: 1.0
sw_version: 1.3.6 Build 230424 Rel.77225n(4555)
device_alias: Dining Room Camera
avatar: camera c212
longitude: 0
latitude: 0
has_set_location_info: 0
features: 3
barcode: 
mac: 28-EE-52-93-E9-D3
dev_id: 80215ACBBFF1B116E989BD4366B7BBF31E273DDA
oem_id: 8902D2F34FCE407721DE92F5759839C2
hw_desc: 48574445534300000000000000000001
alarm: off
user: homeassistant
presets: 
{}

record_plan: 
sunday: '["0000-2400:2"]'
monday: '["0000-2400:2"]'
tuesday: '["0000-2400:2"]'
wednesday: '["0000-2400:2"]'
thursday: '["0000-2400:2"]'
friday: '["0000-2400:2"]'
saturday: '["0000-2400:2"]'

entity_picture: /api/camera_proxy/camera.dining_room?token=xxx
icon: mdi:webcam
friendly_name: Dining Room Camera
supported_features: 3
JurajNyiri commented 8 months ago

It was always like this, camera does not report current mode. Not a bug.

codyc1515 commented 8 months ago

If it does not report current mode, shouldn't the entity be disabled, not created or simply put to off in that case? Not sure how you can say it's not a bug if the integration is presenting an option that will simply never work.

JurajNyiri commented 8 months ago

Have you tried using the option before spreading misinformation? It sets the cruise mode, but camera does not report the state back, so the state is UNKNOWN.

codyc1515 commented 8 months ago

If no response is received then realistically it should be a stateless button for each of horizontal, vertical and off as the state cannot be set.