Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

errors in HA log #1

Open
fcollingwood opened this issue Jul 3, 2020 · 3 comments
Open

errors in HA log #1

fcollingwood opened this issue Jul 3, 2020 · 3 comments

Comments

@fcollingwood
Copy link

fcollingwood commented Jul 3, 2020

Followed the HACS install method and frontend integration to the letter - If there's any assumed knowledge around either, that's a problem. The power socket I am trying to integrate is not showing up.

I am getting the following in the HA log at startup:

2020-07-03 14:50:46 ERROR (MainThread) [custom_components.tuyalocal.pytuya] Unexpected status() payload=b'\x13\xca\x1a\xf0\xc16\xf3YR\xd7\x17\xd2\xd2\xa1*\xeb\x9a\xb5\xc8\xa7\x83\xa04`G4\xe5\t6\xc6\xf1\x15'
2020-07-03 14:50:46 ERROR (MainThread) [homeassistant.components.switch] Error while setting up tuyalocal platform for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 186, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 443, in _async_add_entity
entity.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 297, in async_write_ha_state
self._async_write_ha_state() # type: ignore
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 324, in _async_write_ha_state
attr.update(self.device_state_attributes or {})
File "/config/custom_components/tuyalocal/switch.py", line 183, in device_state_attributes
attrs[ATTR_CURRENT] = "{}".format(self._status['dps'][self._attr_current])
TypeError: byte indices must be integers or slices, not str

@iwzoo
Copy link
Owner

iwzoo commented Jul 3, 2020

how about leaving the current, consumption and voltage with default values?

@fcollingwood
Copy link
Author

They're not set.

@fcollingwood
Copy link
Author

No thoughts?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants