Skip to content

Commit

Permalink
switch: use specific exception to catch and log warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
make-all committed Mar 8, 2024
1 parent bb453fa commit 12e33d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/tuya_local/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def device_class(self):
dclass = self._config.device_class
try:
return SwitchDeviceClass(dclass)
except:
except ValueError:
if dclass:
_LOGGER.warning(
"%s/%s: Unrecognised switch device class of %s ignored",
Expand Down

0 comments on commit 12e33d8

Please sign in to comment.