Skip to content

KeyError result #57

@icicimov

Description

@icicimov

Hi,

I have a single tapo P100 plug setup via tapo app. When trying to integrate to HA 2022.4.3:

switch:
  platform: tapo_p100_control
  ip_address: 192.168.x.x
  email: !secret tapo_user
  password: !secret tapo_password

I get this error in the log:

Logger: homeassistant.components.switch
Source: custom_components/tapo_p100_control/switch.py:83
Integration: Switch (documentation, issues)
First occurred: 14:53:23 (1 occurrences)
Last logged: 14:53:23

Error while setting up tapo_p100_control platform for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/tapo_p100_control/switch.py", line 44, in setup_platform
    add_entities([P100Plug(p100)])
  File "/config/custom_components/tapo_p100_control/switch.py", line 53, in __init__
    self.update()
  File "/config/custom_components/tapo_p100_control/switch.py", line 83, in update
    self._p100.handshake()
  File "/usr/local/lib/python3.9/site-packages/PyP100/PyP100.py", line 124, in handshake
    encryptedKey = r.json()["result"]["key"]
KeyError: 'result'

The plug is switched on and connected to the network via static IP and I can ping it from the hassio host. The device has 2.0 hardware version and firmware is 1.0.6 Build 210721 Rel.180949

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions