Use ZigbeeException instead of DeliveryError in ZHA (#33993)

* Use ZigbeeException instead of DeliveryError

* cleanup get_attributes
This commit is contained in:
David F. Mulcahey 2020-04-11 12:01:49 -04:00 committed by GitHub
parent 8c4a139aeb
commit 946b77e2ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 21 deletions

View file

@ -3,7 +3,7 @@ import functools
import logging
from typing import List
from zigpy.exceptions import DeliveryError
from zigpy.exceptions import ZigbeeException
import zigpy.zcl.clusters.hvac as hvac
from homeassistant.components.fan import (
@ -177,7 +177,7 @@ class FanGroup(BaseFan, ZhaGroupEntity):
"""Set the speed of the fan."""
try:
await self._fan_channel.write_attributes({"fan_mode": value})
except DeliveryError as ex:
except ZigbeeException as ex:
self.error("Could not set speed: %s", ex)
return