diff --git a/changelog b/changelog index 54639c8..a6e53a2 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +0.9.0a9: + I forgot to bump the revision + Fix set availability service 0.9.0a8: fix upgrade issue #2, use config functions not hard coded directory locations 0.9.0a7: diff --git a/custom_components/virtual/__init__.py b/custom_components/virtual/__init__.py index dc3e40d..79bd931 100644 --- a/custom_components/virtual/__init__.py +++ b/custom_components/virtual/__init__.py @@ -29,7 +29,7 @@ from .cfg import BlendedCfg, UpgradeCfg -__version__ = '0.9.0a7' +__version__ = '0.9.0a9' _LOGGER = logging.getLogger(__name__) @@ -144,7 +144,8 @@ async def async_virtual_service_set_available(call) -> None: if not hasattr(hass.data[COMPONENT_SERVICES], COMPONENT_DOMAIN): _LOGGER.debug("installing handlers") hass.data[COMPONENT_SERVICES][COMPONENT_DOMAIN] = 'installed' - hass.services.async_register(COMPONENT_DOMAIN, SERVICE_AVAILABILE, async_virtual_service_set_available) + hass.services.async_register(COMPONENT_DOMAIN, SERVICE_AVAILABILE, + async_virtual_service_set_available, schema=SERVICE_SCHEMA) return True @@ -194,13 +195,11 @@ def get_entity_from_domain(hass, domain, entity_id): async def async_virtual_set_availability_service(hass, call): - entities = call.data['entity_id'] value = call.data['value'] - if type(value) is not bool: value = bool(util.strtobool(value)) - for entity_id in entities: + for entity_id in call.data['entity_id']: domain = entity_id.split(".")[0] _LOGGER.info("{} set_avilable(value={})".format(entity_id, value)) get_entity_from_domain(hass, domain, entity_id).set_available(value) diff --git a/custom_components/virtual/manifest.json b/custom_components/virtual/manifest.json index 2e0ed91..99dc292 100644 --- a/custom_components/virtual/manifest.json +++ b/custom_components/virtual/manifest.json @@ -8,5 +8,5 @@ "documentation": "https://github.com/twrecked/hass-virtual/blob/master/README.md", "iot_class": "local_push", "issue_tracker": "https://github.com/twrecked/hass-virtual/issues", - "version": "0.9.0a6" + "version": "0.9.0a9" }