Skip to content

Commit

Permalink
Update base.py
Browse files Browse the repository at this point in the history
  • Loading branch information
azerty9971 committed Aug 9, 2024
1 parent bb4ed16 commit 4952260
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions homeassistant/components/tuya/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,12 @@ def get_dptype(
try:
return DPType(getattr(self.device, key)[dpcode].type)
except ValueError:
fixed_type = TuyaEntity.determine_dptype(getattr(self.device, key)[dpcode].type)
LOGGER.warning(f"Device {self.device.name} (id: {self.device.id}) has returned a bad model dpId type for code {dpcode} : \"{getattr(self.device, key)[dpcode].type}\", it should have been \"{fixed_type}\". Please contact the Tuya Support about this")
fixed_type = TuyaEntity.determine_dptype(
getattr(self.device, key)[dpcode].type
)
LOGGER.warning(
f'Device {self.device.name} (id: {self.device.id}) has returned a bad model dpId type for code {dpcode} : "{getattr(self.device, key)[dpcode].type}", it should have been "{fixed_type}". Please contact the Tuya Support about this'
)
return fixed_type

return None
Expand Down

0 comments on commit 4952260

Please sign in to comment.