core/homeassistant/components/siren/services.yaml

42 lines
975 B
YAML
Raw Normal View History

Add siren platform (#48309) * Add siren platform * add more supported flags and an ability to set siren duration * tone can be int or string * fix typing * fix typehinting * fix typehints * implement a proposed approach based on discussion * Address comments * fix tests * Small fix * Update homeassistant/components/demo/siren.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/demo/siren.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/demo/siren.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/demo/siren.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/demo/siren.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * typing * use class attributes * fix naming * remove device from service description * Filter out params from turn on service * fix tests * fix bugs and tests * add test * Combine is_on test with turn on/off/toggle service tests * Update homeassistant/components/siren/__init__.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * fix filtering of turn_on attributes * none check * remove services and attributes for volume level, default duration, and default tone * Update homeassistant/components/siren/__init__.py Co-authored-by: Franck Nijhof <frenck@frenck.nl> * Update homeassistant/components/siren/__init__.py Co-authored-by: Franck Nijhof <frenck@frenck.nl> * Update homeassistant/components/siren/__init__.py Co-authored-by: Franck Nijhof <frenck@frenck.nl> * import final * Update homeassistant/components/siren/__init__.py Co-authored-by: Franck Nijhof <frenck@frenck.nl> * Fix typing and used TypedDict for service parameters * remove is_on function * remove class name redundancy * remove extra service descriptions * switch to positive_int * fix schema for tone Co-authored-by: Martin Hjelmare <marhje52@gmail.com> Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-07-11 20:51:11 +00:00
# Describes the format for available siren services
turn_on:
description: Turn siren on.
target:
entity:
domain: siren
fields:
tone:
description: The tone to emit when turning the siren on. Must be supported by the integration.
example: fire
required: false
selector:
text:
volume_level:
description: The volume level of the noise to emit when turning the siren on. Must be supported by the integration.
example: 0.5
required: false
selector:
number:
min: 0
max: 1
step: 0.05
duration:
description: The duration in seconds of the noise to emit when turning the siren on. Must be supported by the integration.
example: 15
required: false
selector:
text:
turn_off:
description: Turn siren off.
target:
entity:
domain: siren
toggle:
description: Toggles a siren.
target:
entity:
domain: siren