Skip to content

Commit

Permalink
Fix Update coordinator.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kds69 authored Nov 20, 2024
1 parent 8eb8a37 commit 7496fc1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions custom_components/openwrt/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ async def do_file_exec(self, command: str, params, env: dict, extra: dict):
result = await self._ubus.api_call(
"file",
"exec",
dict(command=command, params=params, env=env)
if env !={}:
dict(command=command, params=params, env=env)
else:
dict(command=command, params=params)
)
_LOGGER.debug(f"Execute result: {self._id}: {result}")
self._coordinator.hass.bus.async_fire(
Expand Down Expand Up @@ -326,4 +329,4 @@ def new_coordinator(hass, config: dict, all_devices: dict) -> DeviceCoordinator:
_LOGGER.debug(f"new_coordinator: {config}, {all_devices}")
connection = new_ubus_client(hass, config)
device = DeviceCoordinator(hass, config, connection, all_devices)
return device
return device

0 comments on commit 7496fc1

Please sign in to comment.