HandyHat / ha-hildebrandglow-dcc

Home Assistant integration for UK SMETS (Smart) meters pulling data from the DCC via the Hildebrand Glow API
MIT License
231 stars 33 forks source link

Cannot authenticate with Glow #73

Closed EDIflyer closed 2 years ago

EDIflyer commented 2 years ago

Describe the bug Try to login to Glow - receive an error (screenshot below)

To Reproduce

  1. Install Hildebrand Glow (DCC) Integration via HACS
  2. Restart HA
  3. Config > Integration > Add Integration > pick Glow
  4. Receive login popup
  5. Unable to login

Expected behaviour To be able to login to Glow

Screenshots image

Version Integration 0.5.1 HA 2021.11.1

Debug log

This error originated from a custom integration.

Logger: custom_components.hildebrandglow_dcc.config_flow
Source: custom_components/hildebrandglow_dcc/glow.py:46
Integration: Hildebrand Glow (DCC) (documentation, issues)
First occurred: 22:10:16 (1 occurrences)
Last logged: 22:10:16

Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/hildebrandglow_dcc/config_flow.py", line 60, in async_step_user
    info = await validate_input(self.hass, user_input)
  File "/config/custom_components/hildebrandglow_dcc/config_flow.py", line 37, in validate_input
    glow = await hass.async_add_executor_job(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/hildebrandglow_dcc/glow.py", line 46, in authenticate
    response = requests.http.post(url, json=auth, headers=headers)
AttributeError: module 'requests' has no attribute 'http'

Additional context Could this be related to bug #69?

ColinRobbins commented 2 years ago

This has been fixed in 0.5.2.

EDIflyer commented 2 years ago

@ColinRobbins ah, great - how do I get hold of it? 0.5.1 seemed to be the latest listed version on Github?

si458 commented 2 years ago

Duplicate of my issue #69

Just waiting for a new release from @HandyHat 😀

EDIflyer commented 2 years ago

Duplicate of my issue #69

Just waiting for a new release from @HandyHat 😀

Yep I suspected it might be but it had been closed so I couldn't add to it and I wasn't sure if it was the same or not as it looked like it had been sorted in 0.5.1. Excited to try it out tho - have got my accounts all approved in Glow :)

ColinRobbins commented 2 years ago

CORRECTION.
it needs @HandyHat to tag 0.5.2 as a new release.

In the mean time, while waiting for the release, if you edit custom_components/hildebrandglow_dcc/glow.py line 46 from

    response = requests.http.post(url, json=auth, headers=headers)

To

    response = requests.post(url, json=auth, headers=headers)

(Remove ‘.http’) It will work.

EDIflyer commented 2 years ago

Fantastic, thanks @ColinRobbins - logged in fine now! Just need to start playing about with options/capabilities now 😄 🤓

megakid commented 2 years ago

Appreciate the work around before 0.52 is tagged. Thanks!

HandyHat commented 2 years ago

Apologies - v0.5.2 has now been actually released! FYI you can install the main branch via HACS rather than needing to manually edit the file.

Duplicate of #69