Skip to content

feat: Enhance device info with camera details and serial number#39

Open
BenWolstencroft wants to merge 1 commit intomainfrom
feature/camera-details-sensor
Open

feat: Enhance device info with camera details and serial number#39
BenWolstencroft wants to merge 1 commit intomainfrom
feature/camera-details-sensor

Conversation

@BenWolstencroft
Copy link
Copy Markdown
Collaborator

@BenWolstencroft BenWolstencroft commented Jan 8, 2026

Summary

Enhances the device registry and Baby Info sensor with additional camera details from the CuboAI API.

Changes

Device Registry Enhancement

The device now shows the serial number (license ID) in the Home Assistant device info page.

Expanded BabyInfoSensor Attributes

The sensor.cuboai_baby_info_{baby_name} entity now includes additional attributes:

Attribute Description
license_id Camera license/serial number
created Camera registration date
role User role (admin, viewer, etc.)
avatar_url Baby profile picture URL
alexa_enabled Alexa integration status
timezone Configured timezone
sleep_time Sleep report start time
wakeup_time Sleep report end time
report_time Report generation hour
gmt_offset GMT offset

Existing attributes (baby, birth, gender, device_id) remain unchanged.

Technical Changes

  • async_api.py: Added get_camera_details() function to fetch comprehensive camera data
  • sensor.py: Updated CuboBabyInfoSensor to use new API and provide serial_number in device_info
  • tests: Added 4 tests for get_camera_details API function

Testing

All 72 tests pass

@BenWolstencroft BenWolstencroft force-pushed the feature/camera-details-sensor branch 2 times, most recently from b18b0c9 to 510df34 Compare January 8, 2026 21:49
…ce registry

- Add get_camera_details() async API function to extract detailed camera info
  from /user/cameras endpoint
- Enhance CuboBabyInfoSensor to use get_camera_details instead of get_camera_profiles_raw
- Add serial_number (license_id) to device_info for device registry
- Expand BabyInfoSensor attributes to include:
  - Device info: license_id, created date, role
  - Profile: avatar_url (baby name, birth, gender already existed)
  - Settings: alexa_enabled, timezone, sleep/wake times, report settings
- Add 4 tests for get_camera_details API function
@BenWolstencroft BenWolstencroft force-pushed the feature/camera-details-sensor branch from 510df34 to b07339f Compare January 9, 2026 09:11
@BenWolstencroft BenWolstencroft changed the title feat: Add camera details sensor feat: Enhance device info with camera details and serial number Jan 9, 2026
@BenWolstencroft BenWolstencroft added the enhancement New feature or request label Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant