A Home Assistant integration that implements a simple way of triggering a generic event through a service call.
The integration can be installed from HACS or by copying the files under custom_components into the config directory.
To use the component you will need to add the following to your
configuration.yaml file in order to load the integration.
The component has no configuration options.
svc2evnt:
The integration registeres a service called svc2evnt.fire_event. This can be executed using the
standard call_service functionality in Home Assistant.
The arguments accepted as service data to this service is descibed bellow.
| Name | Type | Requried | Supported options | Description |
|---|---|---|---|---|
event_type |
string | yes | Any event type, ex custom_event |
Event type |
data |
string | no | Any data to send with event |
This example uses the custom component "button-card"
Send a custom event with event type custom_event and with data domain: media and id: playpause.
type: 'custom:button-card'
tap_action:
action: call-service
service: svc2evnt.fire_event
service_data:
event_type: custom_event
data:
domain: media
id: playpause
show_icon: true
icon: 'mdi:play-pause'This project gladly accepts contributions.
This project uses semantic release which forces all commit messages to follow the conventional commits format.
The content of the commit message is used in the release process and is added to the changelog. Please take creat care to write desciptive commit messages.
This project uses Black to enforce consistant formatting.
On top of Black we also expect flake8 to pass before a PR will be approved.
You can run the control test suite yourself by running make test
This project uses poetry for package management. To install dev-dependencies run poetry install.