Skip to content

Commit 1f983e8

Browse files
authored
Alpha 05 (#85)
* Fix availability service issue. * Fix availability service issue.
1 parent 640469f commit 1f983e8

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

changelog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
0.9.0a5:
2+
fix availability service issue
13
0.9.0a4:
24
fix time delta import issue
35
0.9.0a3:

custom_components/virtual/__init__.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from .cfg import BlendedCfg, UpgradeCfg
2222

2323

24-
__version__ = '0.9.0a4'
24+
__version__ = '0.9.0a5'
2525

2626
_LOGGER = logging.getLogger(__name__)
2727

@@ -171,11 +171,13 @@ def get_entity_from_domain(hass, domain, entity_id):
171171

172172

173173
async def async_virtual_set_availability_service(hass, call):
174-
entity_id = call.data['entity_id']
174+
entities = call.data['entity_id']
175175
value = call.data['value']
176176

177-
if not type(value) == bool:
177+
if type(value) is not bool:
178178
value = bool(util.strtobool(value))
179-
domain = entity_id.split(".")[0]
180-
_LOGGER.info("{} set_avilable(value={})".format(entity_id, value))
181-
get_entity_from_domain(hass, domain, entity_id).set_available(value)
179+
180+
for entity_id in entities:
181+
domain = entity_id.split(".")[0]
182+
_LOGGER.info("{} set_avilable(value={})".format(entity_id, value))
183+
get_entity_from_domain(hass, domain, entity_id).set_available(value)

custom_components/virtual/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
"documentation": "https://github.com/twrecked/hass-virtual/blob/master/README.md",
99
"iot_class": "local_push",
1010
"issue_tracker": "https://github.com/twrecked/hass-virtual/issues",
11-
"version": "0.9.0a4"
11+
"version": "0.9.0a5"
1212
}

0 commit comments

Comments
 (0)