Increase coverage and cleanup BleBox cover (#35369)

* increase coverage and cleanup BleBox cover

* test entity properites via the `state` property

* properly test entity properities

* properly mock io call
This commit is contained in:
gadgetmobile authored and GitHub committed 2020-05-10 12:22:26 +02:00
1 parent b4142fc7ee
commit 9e3a8899c8
4 files changed
+73 -28

No files matched your search

+5 -1
View File
@@ -77,7 +77,11 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry):
def create_blebox_entities(product, async_add, entity_klass, entity_type):
"""Create entities from a BleBox product's features."""
entities = [entity_klass(feature) for feature in product.features[entity_type]]
entities = []
if entity_type in product.features:
for feature in product.features[entity_type]:
entities.append(entity_klass(feature))
async_add(entities, True)