Improve GitHub Actions (#97)

* Delete hassfest.yaml

* Update and rename ci.yaml to tox.yaml

* Create combined.yaml

* Update hacs.json

* Update README.md

* Update combined.yaml

* Remove unused import

* Restored wrongly deleted line in cover.py

* Update config_flow.py

* Update __init__.py

Co-authored-by: Pierre Ståhl <pierre.staahl@gmail.com>
Co-authored-by: rospogrigio <49229287+rospogrigio@users.noreply.github.com>
This commit is contained in:
Kendell R
2020-10-22 02:43:47 -07:00
committed by GitHub
parent c6de437e86
commit c1878f82e2
16 changed files with 76 additions and 77 deletions

26
.github/workflows/combined.yaml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: "Validation And Formatting"
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Download repo
with:
fetch-depth: 0
- uses: actions/setup-python@v2
name: Setup Python
- uses: actions/cache@v2
name: Cache
with:
path: |
~/.cache/pip
key: custom-component-ci
- uses: KTibow/ha-blueprint@stable
name: CI
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,14 +0,0 @@
name: Validate with hassfest
on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
validate:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
- uses: home-assistant/actions/hassfest@master

View File

@@ -1,4 +1,4 @@
name: CI
name: Tox PR CI
on: [pull_request]
@@ -11,7 +11,6 @@ jobs:
runs-on: ${{ matrix.platform }}
strategy:
matrix:
# https://help.github.com/articles/virtual-environments-for-github-actions
platform:
- ubuntu-latest
python-version:

View File

@@ -1,6 +1,7 @@
![logo](https://github.com/rospogrigio/localtuya-homeassistant/blob/master/img/logo-small.png)
A Home Assistant custom Integration for local handling of Tuya-based devices.
Device status is updated receiving push updates from the device instead of polling, so status updates are extremely fast (even if manually operated).
The following Tuya device types are currently supported:

View File

@@ -58,20 +58,20 @@ import asyncio
import logging
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.const import (
CONF_DEVICE_ID,
CONF_PLATFORM,
CONF_ENTITIES,
CONF_HOST,
CONF_PLATFORM,
EVENT_HOMEASSISTANT_STOP,
SERVICE_RELOAD,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.reload import async_integration_yaml_config
from .const import DATA_DISCOVERY, DOMAIN, TUYA_DEVICE
from .config_flow import config_schema
from .common import TuyaDevice
from .config_flow import config_schema
from .const import DATA_DISCOVERY, DOMAIN, TUYA_DEVICE
from .discovery import TuyaDiscovery
_LOGGER = logging.getLogger(__name__)

View File

@@ -3,10 +3,9 @@ import logging
from functools import partial
import voluptuous as vol
from homeassistant.components.binary_sensor import (
DOMAIN,
DEVICE_CLASSES_SCHEMA,
DOMAIN,
BinarySensorEntity,
)
from homeassistant.const import CONF_DEVICE_CLASS

View File

@@ -3,21 +3,20 @@ import asyncio
import logging
from random import randrange
from homeassistant.const import (
CONF_DEVICE_ID,
CONF_ENTITIES,
CONF_FRIENDLY_NAME,
CONF_HOST,
CONF_ID,
CONF_PLATFORM,
)
from homeassistant.core import callback
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.dispatcher import (
async_dispatcher_connect,
async_dispatcher_send,
)
from homeassistant.const import (
CONF_DEVICE_ID,
CONF_ID,
CONF_FRIENDLY_NAME,
CONF_HOST,
CONF_PLATFORM,
CONF_ENTITIES,
)
from homeassistant.helpers.entity import Entity
from . import pytuya
from .const import CONF_LOCAL_KEY, CONF_PROTOCOL_VERSION, DOMAIN, TUYA_DEVICE

View File

@@ -2,25 +2,24 @@
import logging
from importlib import import_module
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from homeassistant.core import callback
from homeassistant.const import (
CONF_ENTITIES,
CONF_ID,
CONF_HOST,
CONF_DEVICE_ID,
CONF_ENTITIES,
CONF_FRIENDLY_NAME,
CONF_HOST,
CONF_ID,
CONF_PLATFORM,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.core import callback
from . import pytuya
from .const import ( # pylint: disable=unused-import
CONF_DPS_STRINGS,
CONF_LOCAL_KEY,
CONF_PROTOCOL_VERSION,
CONF_DPS_STRINGS,
DATA_DISCOVERY,
DOMAIN,
PLATFORMS,

View File

@@ -4,26 +4,25 @@ import logging
from functools import partial
import voluptuous as vol
from homeassistant.components.cover import (
CoverEntity,
ATTR_POSITION,
DOMAIN,
SUPPORT_CLOSE,
SUPPORT_OPEN,
SUPPORT_STOP,
SUPPORT_SET_POSITION,
ATTR_POSITION,
SUPPORT_STOP,
CoverEntity,
)
from .common import LocalTuyaEntity, async_setup_entry
from .const import (
CONF_COMMANDS_SET,
CONF_CURRENT_POSITION_DP,
CONF_SET_POSITION_DP,
CONF_POSITIONING_MODE,
CONF_POSITION_INVERTED,
CONF_POSITIONING_MODE,
CONF_SET_POSITION_DP,
CONF_SPAN_TIME,
)
from .common import LocalTuyaEntity, async_setup_entry
_LOGGER = logging.getLogger(__name__)

View File

@@ -4,8 +4,8 @@ Entirely based on tuya-convert.py from tuya-convert:
https://github.com/ct-Open-Source/tuya-convert/blob/master/scripts/tuya-discovery.py
"""
import json
import asyncio
import json
import logging
from hashlib import md5

View File

@@ -3,14 +3,14 @@ import logging
from functools import partial
from homeassistant.components.fan import (
FanEntity,
DOMAIN,
SPEED_OFF,
SPEED_HIGH,
SPEED_LOW,
SPEED_MEDIUM,
SPEED_HIGH,
SUPPORT_SET_SPEED,
SPEED_OFF,
SUPPORT_OSCILLATE,
SUPPORT_SET_SPEED,
FanEntity,
)
from .common import LocalTuyaEntity, async_setup_entry

View File

@@ -3,20 +3,16 @@ import logging
from functools import partial
import voluptuous as vol
from homeassistant.const import (
CONF_BRIGHTNESS,
CONF_COLOR_TEMP,
)
from homeassistant.components.light import (
LightEntity,
DOMAIN,
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
DOMAIN,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR_TEMP,
LightEntity,
)
from homeassistant.const import CONF_BRIGHTNESS, CONF_COLOR_TEMP
from .common import LocalTuyaEntity, async_setup_entry
from .const import CONF_BRIGHTNESS_LOWER, CONF_BRIGHTNESS_UPPER

View File

@@ -37,15 +37,15 @@ Credits
import asyncio
import base64
from hashlib import md5
import binascii
import json
import logging
import time
import binascii
import struct
import time
import weakref
from collections import namedtuple
from abc import ABC, abstractmethod
from collections import namedtuple
from hashlib import md5
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes

View File

@@ -3,16 +3,15 @@ import logging
from functools import partial
import voluptuous as vol
from homeassistant.components.sensor import DOMAIN, DEVICE_CLASSES
from homeassistant.components.sensor import DEVICE_CLASSES, DOMAIN
from homeassistant.const import (
CONF_DEVICE_CLASS,
CONF_UNIT_OF_MEASUREMENT,
STATE_UNKNOWN,
)
from .const import CONF_SCALING
from .common import LocalTuyaEntity, async_setup_entry
from .const import CONF_SCALING
_LOGGER = logging.getLogger(__name__)

View File

@@ -3,12 +3,9 @@ import logging
from functools import partial
import voluptuous as vol
from homeassistant.components.switch import DOMAIN, SwitchEntity
from homeassistant.components.switch import (
SwitchEntity,
DOMAIN,
)
from .common import LocalTuyaEntity, async_setup_entry
from .const import (
ATTR_CURRENT,
ATTR_CURRENT_CONSUMPTION,
@@ -17,7 +14,6 @@ from .const import (
CONF_CURRENT_CONSUMPTION,
CONF_VOLTAGE,
)
from .common import LocalTuyaEntity, async_setup_entry
_LOGGER = logging.getLogger(__name__)

View File

@@ -1,6 +1,6 @@
{
"name": "localTuya",
"domains": ["climate","cover", "fan", "light", "sensor", "switch"],
"homeassistant": "0.116.0",
"iot_class": ["Local Push"]
}
{
"name": "Local Tuya",
"domains": ["climate", "cover", "fan", "light", "sensor", "switch"],
"homeassistant": "0.116.0",
"iot_class": ["Local Push"]
}