Skip to content

Commit

Permalink
Update the README file.
Browse files Browse the repository at this point in the history
Add some github actions.
Remove some unused imports.
  • Loading branch information
gicamm committed May 6, 2024
1 parent b62007f commit 9b7a518
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 5 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI actions

on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"

jobs:
ruff:
name: "Ruff"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/[email protected]"

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"

- name: "Install requirements"
run: python3 -m pip install -r requirements-dev.txt

- name: "Run"
run: python3 -m ruff check .

tests:
runs-on: "ubuntu-latest"
name: Run tests
steps:
- name: Check out code from GitHub
uses: "actions/checkout@v4"
- name: Setup Python
uses: "actions/setup-python@v5"
with:
python-version: "3.12"
- name: Install requirements
run: python3 -m pip install -r requirements-dev.txt
- name: Run tests
run: |
pytest --cov=./ --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Comelit SimpleHome/Vedo integration for Home Assistant
# Comelit SimpleHome and Comelit Vedo integration for Home Assistant

[![GitHub Release](https://img.shields.io/github/release/gicamm/homeassistant-comelit.svg?style=flat-square)](https://github.com/gicamm/homeassistant-comelit/releases)
[![GitHub Release](https://img.shields.io/github/commit-activity/y/gicamm/homeassistant-comelit.svg?style=flat-square)](https://github.com/gicamm/homeassistant-comelit/commits)
[![Test Coverage](https://img.shields.io/codecov/c/gh/gicamm/homeassistant-comelit?style=flat-square)](https://app.codecov.io/gh/gicamm/homeassistant-comelit/)
[![License](https://img.shields.io/github/license/gicamm/homeassistant-comelit.svg?style=flat-square)](LICENSE)

[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=gicamm&repository=homeassistant-comelit&category=integration)

Comelit SimpleHome/Vedo integration lets you connect your Home Assistant instance to Comelit Simple Home and Vedo
Comelit SimpleHome and Comelit Vedo integration lets you connect your Home Assistant instance to Comelit Simple Home and
Vedo
systems.

For more information, see the [Wiki](https://github.com/gicamm/homeassistant-comelit/wiki).
Expand Down
2 changes: 1 addition & 1 deletion custom_components/comelit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from homeassistant.const import (CONF_HOST, CONF_USERNAME, CONF_PASSWORD, CONF_PORT, CONF_SCAN_INTERVAL)
from .hub import ComelitHub
from .vedo import ComelitVedo
from .const import DOMAIN, HUB_DOMAIN, VEDO_DOMAIN, CONF_MQTT_USER, CONF_MQTT_PASSWORD, CONF_SERIAL, CONF_CLIENT
from .const import DOMAIN, CONF_MQTT_USER, CONF_MQTT_PASSWORD, CONF_SERIAL, CONF_CLIENT
_LOGGER = logging.getLogger(__name__)


Expand Down
2 changes: 1 addition & 1 deletion custom_components/comelit/vedo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import requests
import logging
from threading import Thread
from wrapt_timeout_decorator import *
from wrapt_timeout_decorator import timeout
from homeassistant.const import STATE_ALARM_DISARMED, STATE_ALARM_ARMED_AWAY, STATE_ON, STATE_OFF
from .binary_sensor import VedoSensor
from custom_components.comelit.alarm_control_panel import VedoAlarm
Expand Down
3 changes: 3 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-r requirements.txt
pytest-homeassistant-custom-component==0.13.115
ruff==0.4.2
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# sudo apt install python3-pip python3-dev python3-venv autoconf libssl-dev libxml2-dev libxslt1-dev libjpeg-dev libffi-dev libudev-dev zlib1g-dev pkg-config libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libavresample-dev libavfilter-dev ffmpeg
homeassistant==2023.7.3
homeassistant==2024.4.4
paho-mqtt
wrapt-timeout-decorator
dill
Expand Down
Empty file added tests/__init__.py
Empty file.
12 changes: 12 additions & 0 deletions tests/test_init.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""Test weenect setup process."""


# TODO
async def test_setup_hub(hass):
# TODO: Implement the actual test logic
assert 1 == 1


async def test_setup_vedo(hass):
# TODO: Implement the actual test logic
assert 1 == 1

0 comments on commit 9b7a518

Please sign in to comment.