mirror of
https://github.com/sascha-hemi/hacs_waste_collection_schedule.git
synced 2026-03-21 03:04:09 +01:00
fix fetch_data service call
> takes 0 positional arguments but 1 was given fix #705
This commit is contained in:
@@ -7,7 +7,7 @@ from random import randrange
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
import homeassistant.util.dt as dt_util
|
||||
import voluptuous as vol
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.core import HomeAssistant, ServiceCall, callback
|
||||
from homeassistant.helpers.dispatcher import dispatcher_send
|
||||
|
||||
from .const import DOMAIN, UPDATE_SENSORS_SIGNAL
|
||||
@@ -123,12 +123,14 @@ async def async_setup(hass: HomeAssistant, config: dict):
|
||||
|
||||
# initial fetch of all data
|
||||
hass.add_job(api._fetch)
|
||||
|
||||
def fetch_data():
|
||||
|
||||
async def async_fetch_data(service: ServiceCall) -> None:
|
||||
hass.add_job(api._fetch)
|
||||
|
||||
# Register new Service fetch_data
|
||||
hass.services.async_register(DOMAIN, 'fetch_data', fetch_data)
|
||||
hass.services.async_register(
|
||||
DOMAIN, "fetch_data", async_fetch_data, schema=vol.Schema({})
|
||||
)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
fetch_data:
|
||||
name: fetch_data
|
||||
description: fetch current source data
|
||||
name: Fetch data from all sources.
|
||||
description: Fetch data from all sources.
|
||||
|
||||
Reference in New Issue
Block a user