Skip to content

Commit

Permalink
* Fix service write
Browse files Browse the repository at this point in the history
  • Loading branch information
BenPru committed Nov 30, 2023
1 parent 83e9874 commit 183cd8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions custom_components/luxtronik/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
def setup_hass_services(hass: HomeAssistant, entry: ConfigEntry):
"""Home Assistant services."""

def write_parameter(service):
async def write_parameter(service):
"""Write a parameter to the Luxtronik heatpump."""
parameter = service.data.get(ATTR_PARAMETER)
value = service.data.get(ATTR_VALUE)
coordinator = LuxtronikCoordinator.connect(hass, entry)
coordinator.write(parameter, value)
data = hass.data[DOMAIN].get(entry.entry_id)
coordinator: LuxtronikCoordinator = data[CONF_COORDINATOR]
await coordinator.async_write(parameter, value)

hass.services.register(
DOMAIN, SERVICE_WRITE, write_parameter, schema=SERVICE_WRITE_SCHEMA
Expand Down
2 changes: 1 addition & 1 deletion custom_components/luxtronik/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"after_dependencies": [],
"codeowners": ["@BenPru"],
"iot_class": "local_polling",
"version": "2023.11.29",
"version": "2023.11.30",
"homeassistant": "2023.1.0",
"dhcp": [
{ "macaddress": "000E8C*" },
Expand Down

0 comments on commit 183cd8d

Please sign in to comment.