Skip to content

HM-CC-TC was not recognized#26623

Merged
pvizeli merged 2 commits into
home-assistant:devfrom
MajestyIV:bugfix/#25455
Sep 23, 2019
Merged

HM-CC-TC was not recognized#26623
pvizeli merged 2 commits into
home-assistant:devfrom
MajestyIV:bugfix/#25455

Conversation

@MajestyIV
Copy link
Copy Markdown
Contributor

#25196 Description: Fixes Homematic HM-TC-CC exception. This device has no control mode what leads to an ecxeption.

Related issue (if applicable): fixes #25455

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

@homeassistant
Copy link
Copy Markdown
Contributor

Hi @MajestyIV,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

Copy link
Copy Markdown
Contributor

@danielperna84 danielperna84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems ok for me. @pvizeli ?

@MajestyIV
Copy link
Copy Markdown
Contributor Author

@pvizeli Any words on this? Would be great if we could get a solution into the repository.

if HMIP_CONTROL_MODE in self._data:
return self._data[HMIP_CONTROL_MODE]
# Homematic
return self._data["CONTROL_MODE"]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return self._data.get("")

mode = mode.lower()
except KeyError:
# In case that the device has no control mode
return None
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead, to fire an exception, we should add a guard before.

if not self._hm_control_mode:
    return None

@MajestyIV
Copy link
Copy Markdown
Contributor Author

What about the _hm_control_mode function?

@pvizeli
Copy link
Copy Markdown
Member

pvizeli commented Sep 23, 2019

There is a comment about

@MajestyIV
Copy link
Copy Markdown
Contributor Author

Sorry, missed that part. I made the changed, tested it and it work. Thanks!

@pvizeli pvizeli added this to the 0.99.3 milestone Sep 23, 2019
@pvizeli pvizeli merged commit 2c80ce3 into home-assistant:dev Sep 23, 2019
@lock lock Bot locked and limited conversation to collaborators Sep 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Homematic HM-CC-TC not recognized

5 participants