Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/filipvh/hass-nhc2 into fi…
Browse files Browse the repository at this point in the history
…lipvh-master
  • Loading branch information
boced66 committed Mar 7, 2022
2 parents d59f22d + 6efc1b4 commit dc11149
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 93 deletions.
4 changes: 3 additions & 1 deletion custom_components/nhc2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from .const import DOMAIN, KEY_GATEWAY, CONF_SWITCHES_AS_LIGHTS
from .helpers import extract_versions

REQUIREMENTS = ['nhc2-coco==1.4.1']

_LOGGER = logging.getLogger(__name__)

DOMAIN = DOMAIN
Expand Down Expand Up @@ -67,7 +69,7 @@ async def async_setup(hass, config):

async def async_setup_entry(hass, entry):
"""Create a NHC2 gateway."""
from .coco import CoCo
from nhc2_coco import CoCo
coco = CoCo(
address=entry.data[CONF_HOST],
username=entry.data[CONF_USERNAME],
Expand Down
6 changes: 3 additions & 3 deletions custom_components/nhc2/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
SUPPORT_TARGET_TEMPERATURE_RANGE
)

from .coco import CoCo
from .coco_climate import CoCoThermostat
from .coco_device_class import CoCoDeviceClass
from nhc2_coco import CoCo
from nhc2_coco.coco_climate import CoCoThermostat
from nhc2_coco.coco_device_class import CoCoDeviceClass

from .const import DOMAIN, KEY_GATEWAY, BRAND, CLIMATE
from .helpers import nhc2_entity_processor
Expand Down
87 changes: 0 additions & 87 deletions custom_components/nhc2/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,90 +17,3 @@
SUN_BLIND = 'sunblind'
GATE = 'gate'
VENETIAN_BLIND = 'venetianblind'


import paho.mqtt.client as mqtt

from enum import Enum


MQTT_TLS_VERSION = 2
MQTT_PROTOCOL = mqtt.MQTTv311
MQTT_TRANSPORT = "tcp"
MQTT_CERT_FILE = '/coco_ca.pem'


VALUE_DIMMER = 'dimmer'

LIST_VALID_LIGHTS = ['light', VALUE_DIMMER]
LIST_VALID_SWITCHES = ['socket', 'switched-generic']
LIST_VALID_SHUTTERS = ['rolldownshutter', 'sunblind', 'gate', 'venetianblind']
LIST_VALID_FANS = ['fan']
LIST_VALID_SWITCHED_FANS = ['switched-fan']
LIST_VALID_THERMOSTATS = ['thermostat']
LIST_VALID_GENERICS = ['generic']

DEVICE_CONTROL_BUFFER_SIZE = 16
DEVICE_CONTROL_BUFFER_COMMAND_SIZE = 32

KEY_ACTION = 'Action'
KEY_BRIGHTNESS = 'Brightness'
KEY_DEVICES = 'Devices'
KEY_DISPLAY_NAME = 'DisplayName'
KEY_ENTITY = 'entity'
KEY_FAN_SPEED = 'FanSpeed'
KEY_METHOD = 'Method'
KEY_MODEL = 'Model'
KEY_NAME = 'Name'
KEY_ONLINE = 'Online'
KEY_PARAMS = 'Params'
KEY_PROPERTIES = 'Properties'
KEY_POSITION = 'Position'
KEY_STATUS = 'Status'
KEY_TYPE = 'Type'
KEY_UUID = 'Uuid'
KEY_BASICSTATE = "BasicState"

VALUE_ON = 'On'
VALUE_OFF = 'Off'
VALUE_OPEN = 'Open'
VALUE_STOP = 'Stop'
VALUE_CLOSE = 'Close'
VALUE_TRIGGERED = 'Triggered'

THERM_PROGRAM = 'Program'
THERM_OVERRULEACTION = 'OverruleActive'
THERM_OVERRULESETPOINT = 'OverruleSetpoint'
THERM_OVERRULETIME = 'OverruleTime'
THERM_ECOSAVE = 'EcoSave'

DEV_TYPE_ACTION = 'action'

INTERNAL_KEY_CALLBACK = 'callbackHolder'
INTERNAL_KEY_MODELS = 'models'
INTERNAL_KEY_CLASS = 'class'

CALLBACK_HOLDER_PROP = 'callbackHolder'

MQTT_METHOD_SYSINFO_PUBLISH = 'systeminfo.publish'
MQTT_METHOD_SYSINFO_PUBLISHED = 'systeminfo.published'
MQTT_METHOD_DEVICES_LIST = 'devices.list'
MQTT_METHOD_DEVICES_CONTROL = 'devices.control'
MQTT_METHOD_DEVICES_STATUS = 'devices.status'
MQTT_METHOD_DEVICES_CHANGED = 'devices.changed'

MQTT_RC_CODES = ['',
'Connection refused - incorrect protocol version',
'Connection refused - invalid client identifier',
'Connection refused - server unavailable',
'Connection refused - bad username or password',
'Connection refused - not authorised']

MQTT_TOPIC_PUBLIC_AUTH_CMD = 'public/authentication/cmd'
MQTT_TOPIC_PUBLIC_AUTH_RSP = 'public/authentication/rsp'
MQTT_TOPIC_SUFFIX_SYS_EVT = '/system/evt'
MQTT_TOPIC_PUBLIC_CMD = '/system/cmd'
MQTT_TOPIC_PUBLIC_RSP = '/system/rsp'
MQTT_TOPIC_SUFFIX_CMD = '/control/devices/cmd'
MQTT_TOPIC_SUFFIX_RSP = '/control/devices/rsp'
MQTT_TOPIC_SUFFIX_EVT = '/control/devices/evt'
4 changes: 2 additions & 2 deletions custom_components/nhc2/manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"domain": "nhc2",
"name": "Niko Home Control II",
"requirements": ["paho-mqtt==1.6.1"],
"requirements": ["nhc2-coco==1.4.1"],
"config_flow": true,
"issue_tracker": "https://github.com/filipvh/hass-nhc2/issues",
"documentation": "https://github.com/filipvh/hass-nhc2/blob/master/README.md",
"codeowners": ["@filipvh"],
"version": "2022.3.1"
"version": "2021.4.1"
}

0 comments on commit dc11149

Please sign in to comment.