Skip to content

feat(#267): expose TUTK/Kalay camera credentials as Granary camera feeder attributes - #269

Open
dennismdejong wants to merge 3 commits into
jjjonesjr33:devfrom
dennismdejong:feat/267-tutk-credentials
Open

feat(#267): expose TUTK/Kalay camera credentials as Granary camera feeder attributes#269
dennismdejong wants to merge 3 commits into
jjjonesjr33:devfrom
dennismdejong:feat/267-tutk-credentials

Conversation

@dennismdejong

Copy link
Copy Markdown
Contributor

Summary

Closes #267 — expose the Granary Smart Camera Feeder's TUTK/Kalay camera credentials as sensor attributes so users can use them with external TUTK clients (e.g. go2rtc) to stream the feed locally.

The issue author verified that POST /member/third/tutk/info (empty payload) works for both primary and shared accounts, returning data.userToken + data.appTutkUrl. The cameraId (20-char Kalay UID) comes from the device record, and cameraAuthInfo from realInfo.

Changes

  • api.py: new tutk_info() method for /member/third/tutk/info (account-scoped, empty payload)
  • granary_smart_camera_feeder.py:
    • refresh fetches TUTK info (isolated in its own try/except so a failure can't break the whole refresh)
    • new properties: camera_id, camera_auth_info, tutk_user_token, tutk_app_url, enable_camera, camera_switch, motion_detection_switch, sound_detection_switch
  • sensor.py: exposes these as attributes on the wifi_ssid sensor entity of the device (single entity, not duplicated across all sensors)
  • README.md: note documenting the exposed credentials

Scope

This deliberately does not build a full camera platform (would require bundling the IOTC SDK / go2rtc bridge). It provides the credential layer every streaming approach needs. IOTC/streaming README depth left to the maintainer's judgment.

Review feedback applied

  • Fixed TypeError from merging extra_state_attributes when HA returns None
  • Isolated tutk_info in refresh so a failed call degrades gracefully
  • Scoped attributes to a single entity (wifi_ssid) to avoid duplicating credentials across ~15 sensors
  • Removed unused serial parameter (endpoint is account-scoped)

@dennismdejong

Copy link
Copy Markdown
Contributor Author

@jjjonesjr33 @Sarcaris2000 PR is open for the TUTK/Kalay camera credential exposure discussed in #267. Scope is deliberately minimal (credential attributes + docs, no full camera platform). @Sarcaris2000 — thanks again for confirming the endpoint shapes; if you want to verify the attributes against your shared-account setup once merged, that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PLAF203: shared/secondary accounts receive identical cameraId + cameraAuthInfo — camera restriction appears to be app-side only

1 participant