Skip to content

Extract Supported features into own funciton#2151

Merged
balloob merged 4 commits intohome-assistant:devfrom
iantrich:supported-features
Nov 30, 2018
Merged

Extract Supported features into own funciton#2151
balloob merged 4 commits intohome-assistant:devfrom
iantrich:supported-features

Conversation

@iantrich
Copy link
Copy Markdown
Member

No description provided.

if (domain === "climate") {
// tslint:disable-next-line
return (stateObj.attributes.supported_features! & 4096) !== 0;
return supportsFeature(stateObj, 4096);
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.

4096 should be stored in a constant under src/data/climate.ts

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.

Yeah. Debated doing so but thought best to do later.

supportsTemperature(stateObj) {
return (
(stateObj.attributes.supported_features & 1) !== 0 &&
supportsFeature(stateObj, 1) &&
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.

constants? (or maybe out of scope for this PR)

@ghost ghost assigned balloob Nov 30, 2018
@balloob balloob merged commit 882c503 into home-assistant:dev Nov 30, 2018
@ghost ghost removed the in progress label Nov 30, 2018
@iantrich iantrich deleted the supported-features branch November 30, 2018 15:59
@balloob balloob mentioned this pull request Dec 5, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2022
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.

3 participants