Skip to content

Fix attribute entity#8066

Merged
balloob merged 7 commits into
home-assistant:devfrom
pvizeli:fix_attribute_entity
Jun 17, 2017
Merged

Fix attribute entity#8066
balloob merged 7 commits into
home-assistant:devfrom
pvizeli:fix_attribute_entity

Conversation

@pvizeli
Copy link
Copy Markdown
Member

@pvizeli pvizeli commented Jun 16, 2017

Description:

Fix a bug that attribute entity not present if they is False or 0

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@pvizeli pvizeli added this to the 0.47 milestone Jun 16, 2017
@mention-bot
Copy link
Copy Markdown

@pvizeli, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @robbiet480 and @Diaoul to be potential reviewers.

self.assertIsNone(state.attributes.get('white_value'))
self.assertIsNone(state.attributes.get('xy_color'))
self.assertIsNone(state.attributes.get(ATTR_ASSUMED_STATE))
self.assertFalse(state.attributes.get(ATTR_ASSUMED_STATE))
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.

We should not add assumed state. I guess we should have assumed_state default to return None

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👍

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@balloob done. The problem is, if a device support assume_state it will be present but on a device without that implement it will not present. I think that is correct.

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.

yes.

@pvizeli pvizeli removed this from the 0.47 milestone Jun 17, 2017
@pvizeli pvizeli closed this Jun 17, 2017
@pvizeli pvizeli mentioned this pull request Jun 17, 2017
2 tasks
@pvizeli pvizeli reopened this Jun 17, 2017
@pvizeli pvizeli added this to the 0.47 milestone Jun 17, 2017
@balloob balloob merged commit 2438c6b into home-assistant:dev Jun 17, 2017
@balloob
Copy link
Copy Markdown
Member

balloob commented Jun 17, 2017

Cherry-picked for 0.47

balloob pushed a commit that referenced this pull request Jun 17, 2017
* Bugfix entity attribute setter

* Fix tests

* Fix tests part 2

* Change filter only None

* Fix tests part 3

* Update entity.py

* Fix tests
@balloob balloob mentioned this pull request Jun 17, 2017
@balloob balloob mentioned this pull request Jul 1, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Oct 20, 2017
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.

5 participants