Don't dispatch to components when there are no channels for ZHA sensors (#21223)

* don't dispatch when channels don't exist

* review comment
This commit is contained in:
David F. Mulcahey 2019-02-20 10:27:03 -05:00 committed by Pascal Vizeli
parent 5115dfada2
commit 5b24b271cc
1 changed files with 4 additions and 0 deletions

View File

@ -253,6 +253,10 @@ async def _create_cluster_channel(cluster, zha_device, is_new_join,
async def _dispatch_discovery_info(hass, is_new_join, discovery_info):
"""Dispatch or store discovery information."""
if not discovery_info['channels']:
_LOGGER.warning(
"there are no channels in the discovery info: %s", discovery_info)
return
component = discovery_info['component']
if is_new_join:
async_dispatcher_send(