8000 RFC: Add set_state service to Camera · Issue #35 · home-assistant/architecture · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
RFC: Add set_state service to Camera #35
Closed
home-assistant/core
#15051
@awarecan

Description

@awarecan

Camera defined three states [STATE_RECORDING, STATE_STREAMING, STATE_IDLE], but don't have services to allow user change state.

Proposed Solution:

Add abstract set_state set_mode service to Camera, take entity_id and state mode as parameter. Using different mode const to clarify that shall not directly set state machine, [MODE_RECORDING, MODE_STREAMING, MODE_IDLE]. Each platform should have its own implementation

Alternative Solution:

Add generic turn_on turn_off service to Camera.

  • turn_on has entity_id and state mode as parameter (MODE_RECORDING or MODE_STREAMING)
  • turn_off only has entity_id

Approved Solution:

  • Adds supported_feature support modeled after the light component. Limit to only turn_on/turn_off as a feature.
  • Add service to turn on/off a camera entity (also modeled after how light component does services)
  • Update the demo component to support turn on/off. Do not include other platforms in this PR.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0