Hernrup/homeassistant-svc2evnt

Integration for Home Assistant that allows a service to fire generic events

★ 6Forks 3PythonGitHub ↗Compare

README

svc2evnt

hacs_badge Gitter semantic-release badge badge badge action 1 badge action 2 badge

A Home Assistant integration that implements a simple way of triggering a generic event through a service call.

Installation

The integration can be installed from HACS or by copying the files under custom_components into the config directory.

Configuration

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:

Usage

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.

Service data

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

Example

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'

Contributions

This project gladly accepts contributions.

Style guide

Commit messages

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.

Python code style

This project uses Black to enforce consistant formatting.

Quality controls

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

Dev environment

This project uses poetry for package management. To install dev-dependencies run poetry install.

Contributors

Hernrupactions-userfrosenlind

Issues