Skip to content

Commit

Permalink
Merge pull request #257 from gigatexel/master
Browse files Browse the repository at this point in the history
General maintenance
  • Loading branch information
JoDehli authored Mar 29, 2024
2 parents 79d1d04 + db06ecc commit 8d38a54
Show file tree
Hide file tree
Showing 11 changed files with 114 additions and 48 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/hassfest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Validate with hassfest

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

jobs:
validate:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: home-assistant/actions/hassfest@master
18 changes: 18 additions & 0 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Validate

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

jobs:
validate-hacs:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- name: HACS validation
uses: "hacs/action@main"
with:
category: "integration"
30 changes: 15 additions & 15 deletions custom_components/loxone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ async def async_config_entry_updated(hass, entry) -> None:
pass


async def create_group_for_loxone_enties(hass, entites, name, object_id):
async def create_group_for_loxone_entities(hass, entities, name, object_id):
try:
await group.Group.async_create_group(
hass,
name,
created_by_service=False,
entity_ids=entites,
entity_ids=entities,
icon=None,
mode=None,
object_id=object_id,
Expand All @@ -152,7 +152,7 @@ async def create_group_for_loxone_enties(hass, entites, name, object_id):
await group.Group.async_create_group(
hass,
name,
entity_ids=entites,
entity_ids=entities,
icon=None,
mode=None,
object_id=object_id,
Expand Down Expand Up @@ -310,50 +310,50 @@ async def loxone_discovered(event):
numbers.sort()
texts.sort()

await create_group_for_loxone_enties(
await create_group_for_loxone_entities(
hass, sensors_analog, "Loxone Analog Sensors", "loxone_analog"
)
await create_group_for_loxone_enties(
await create_group_for_loxone_entities(
hass,
sensors_digital,
"Loxone Digital Sensors",
"loxone_digital",
)
await create_group_for_loxone_enties(
await create_group_for_loxone_entities(
hass, switches, "Loxone Switches", "loxone_switches"
)
await create_group_for_loxone_enties(
await create_group_for_loxone_entities(
hass, covers, "Loxone Covers", "loxone_covers"
)
await create_group_for_loxone_enties(
await create_group_for_loxone_entities(
hass, lights, "Loxone LightControllers", "loxone_lights"
)
await create_group_for_loxone_enties(
await create_group_for_loxone_entities(
hass, lights, "Loxone Dimmer", "loxone_dimmers"
)
await create_group_for_loxone_enties(
await create_group_for_loxone_entities(
hass, climates, "Loxone Room Controllers", "loxone_climates"
)
await create_group_for_loxone_enties(
await create_group_for_loxone_entities(
hass,
fans,
"Loxone Ventilation Controllers",
"loxone_ventilations",
)
await create_group_for_loxone_enties(
await create_group_for_loxone_entities(
hass,
accontrols,
"Loxone AC Controllers",
"loxone_accontrollers",
)
await create_group_for_loxone_enties(
await create_group_for_loxone_entities(
hass, numbers, "Loxone Numbers", "loxone_numbers"
)
await create_group_for_loxone_enties(
await create_group_for_loxone_entities(
hass, texts, "Loxone Texts", "loxone_texts"
)
await hass.async_block_till_done()
await create_group_for_loxone_enties(
await create_group_for_loxone_entities(
hass,
[
"group.loxone_analog",
Expand Down
16 changes: 8 additions & 8 deletions custom_components/loxone/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async def async_setup_entry(
"""Set up entry."""
miniserver = get_miniserver_from_hass(hass)
loxconfig = miniserver.lox_config.json
entites = []
entities = []

for fan in get_all(loxconfig, "Ventilation"):
fan.update(
Expand All @@ -80,7 +80,7 @@ async def async_setup_entry(
"async_add_devices": async_add_entities,
"config_entry": config_entry,
}
entites.append(LoxoneDigitalSensor(**presence))
entities.append(LoxoneDigitalSensor(**presence))
if fan["details"]["hasIndoorHumidity"] and "humidityIndoor" in fan["states"]:
humidity = {
"parent_id": fan["uuidAction"],
Expand All @@ -94,7 +94,7 @@ async def async_setup_entry(
"async_add_devices": async_add_entities,
"config_entry": config_entry,
}
entites.append(Loxonesensor(**humidity))
entities.append(Loxonesensor(**humidity))
if fan["details"]["hasAirQuality"] and "airQualityIndoor" in fan["states"]:
air_quality = {
"parent_id": fan["uuidAction"],
Expand All @@ -108,7 +108,7 @@ async def async_setup_entry(
"async_add_devices": async_add_entities,
"config_entry": config_entry,
}
entites.append(Loxonesensor(**air_quality))
entities.append(Loxonesensor(**air_quality))
# if "temperatureIndoor" in fan["states"]:
# temperature = {
# "parent_id": fan["uuidAction"],
Expand All @@ -122,7 +122,7 @@ async def async_setup_entry(
# },
# "async_add_devices": async_add_entities
# }
# entites.append(Loxonesensor(**temperature))
# entities.append(Loxonesensor(**temperature))
if "temperatureOutdoor" in fan["states"]:
temperature = {
"parent_id": fan["uuidAction"],
Expand All @@ -136,11 +136,11 @@ async def async_setup_entry(
"async_add_devices": async_add_entities,
"config_entry": config_entry,
}
entites.append(Loxonesensor(**temperature))
entities.append(Loxonesensor(**temperature))

entites.append(LoxoneVentilation(**fan))
entities.append(LoxoneVentilation(**fan))

async_add_entities(entites)
async_add_entities(entities)


class LoxoneVentilation(LoxoneEntity, FanEntity):
Expand Down
12 changes: 6 additions & 6 deletions custom_components/loxone/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def async_setup_entry(
"generate_lightcontroller_subcontrols", False
)
loxconfig = miniserver.lox_config.json
entites = []
entities = []
all_light_controller_dimmers = []
all_color_picker = []
all_switches = []
Expand Down Expand Up @@ -138,7 +138,7 @@ async def async_setup_entry(
light_controller["subControls"][sub_controll]
)

entites.append(new_light_controller)
entities.append(new_light_controller)

_ = all_dimmers + all_light_controller_dimmers

Expand Down Expand Up @@ -169,7 +169,7 @@ async def async_setup_entry(
)

new_dimmer = LoxoneDimmer(**dimmer)
entites.append(new_dimmer)
entities.append(new_dimmer)

for switch in all_switches:
switch.update(
Expand All @@ -185,7 +185,7 @@ async def async_setup_entry(
}
)
new_switch = LoxoneLight(**switch)
entites.append(new_switch)
entities.append(new_switch)

for color_picker in all_color_picker:
color_picker.update(
Expand All @@ -201,9 +201,9 @@ async def async_setup_entry(
}
)
new_color_picker = LoxoneColorPickerV2(**color_picker)
entites.append(new_color_picker)
entities.append(new_color_picker)

async_add_entities(entites)
async_add_entities(entities)


class LoxonelightcontrollerV2(LoxoneEntity, LightEntity):
Expand Down
10 changes: 4 additions & 6 deletions custom_components/loxone/manifest.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
{
"domain": "loxone",
"name": "PyLoxone",
"codeowners": ["@JoDehli"],
"config_flow": true,
"dependencies": [],
"documentation": "https://github.com/JoDehli/PyLoxone",
"iot_class": "local_polling",
"issue_tracker": "https://github.com/JoDehli/PyLoxone/issues",
"requirements": [
"websockets",
"pycryptodome",
"numpy",
"httpx"
],
"dependencies": [],
"codeowners": ["JoDehli"],
"iot_class": "local_polling",
"homeassistant": "2024.02.0",
"render_readme": true,
"config_flow": true,
"version": "0.6.3"
}
6 changes: 3 additions & 3 deletions custom_components/loxone/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async def async_setup_entry(
"""Load Loxone Audio zones based on a config entry."""
miniserver = get_miniserver_from_hass(hass)
loxconfig = miniserver.lox_config.json
entites = []
entities = []

for audioZone in get_all(loxconfig, "AudioZoneV2"):
audioZone.update(
Expand All @@ -68,9 +68,9 @@ async def async_setup_entry(
"cat": get_cat_name_from_cat_uuid(loxconfig, audioZone.get("cat", "")),
}
)
entites.append(LoxoneAudioZoneV2(**audioZone))
entities.append(LoxoneAudioZoneV2(**audioZone))

async_add_entities(entites)
async_add_entities(entities)


def play_state_to_media_player_state(play_state: int) -> MediaPlayerState:
Expand Down
6 changes: 3 additions & 3 deletions custom_components/loxone/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def async_setup_entry(
"""Set up entry."""
miniserver = get_miniserver_from_hass(hass)
loxconfig = miniserver.lox_config.json
entites = []
entities = []

for number_entity in get_all(loxconfig, ["Slider"]):
number_entity.update(
Expand All @@ -56,9 +56,9 @@ async def async_setup_entry(
}
)
new_number = LoxoneNumber(**number_entity)
entites.append(new_number)
entities.append(new_number)

async_add_entities(entites)
async_add_entities(entities)


class LoxoneNumber(LoxoneEntity, NumberEntity):
Expand Down
2 changes: 0 additions & 2 deletions custom_components/loxone/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ def __init__(self, **kwargs):
self._state = STATE_UNKNOWN
self._icon = None
self._assumed = False
# self._native_max_value = kwargs["details"]["max"]
# self._native_min_value = kwargs["details"]["min"]
self._native_value = ""

@property
Expand Down
47 changes: 43 additions & 4 deletions custom_components/loxone/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"title": "Loxone",
"description": "Loxone Configuration",
"data": {
"host": "Host",
"username": "User",
"port": "Port",
"host": "Miniserver Ip",
Expand All @@ -24,7 +23,6 @@
"step": {
"init": {
"data": {
"host": "Host",
"username": "User",
"port": "Port",
"host": "Miniserver Ip",
Expand All @@ -37,6 +35,47 @@
"title": "PyLoxone settings"
}
}
},
"services": {
"event_websocket_command": {
"name": "Send Websocket command",
"description": "Send websocket commands to the loxone server. You can send a command to the Miniserver using an entity or using a UUID. If you specify both, the command will be sent to the Entity. More info and commands https://www.loxone.com/dede/kb/api/",
"fields": {
"uuid": {
"name": "UUID",
"description": "Uuid for entity which you want to send a command."
},
"device": {
"name": "Entity",
"description": "Device which you want to send a command"
},
"value": {
"name": "Command",
"description": "Command which you want to send"
}
}
},
"sync_areas": {
"name": "Sync areas",
"description": "Applies areas to the loxone entites based on the room from loxone. If area not exists entites will not be changed",
"fields": {
"create_areas": {
"name": "Create areas",
"description": "Force to create areas when they not exist in HA"
}
}
},
"enable_sun_automation": {
"name": "Enable sun automation",
"description": "Enable Sun automation for Loxone Jalousie"
},
"disable_sun_automation": {
"name": "Disable sun automation",
"description": "Disable Sun automation for Loxone Jalousie"
},
"quick_shade": {
"name": "Quick shade",
"description": "Move Loxone Jalousie to shade position. Position is set by Loxone depends on multiple values."
}
}

}
}
1 change: 0 additions & 1 deletion hacs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"country": "DE",
"hacs": "1.0.0",
"render_readme": true,
"domains": ["sensor", "switch", "cover", "light", "scene", "alarm_control_panel"],
"homeassistant": "2024.3.0"
}

0 comments on commit 8d38a54

Please sign in to comment.