Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add climate platform to Mazda integration #75037
Add climate platform to Mazda integration #75037
Changes from all commits
8bb3706
8100781
c699f8f
1e3799d
f3c26f8
8b09d2c
376d73d
2628b5e
d81e9e4
8b335a4
7f4cc96
cfde695
ca8ca9b
3b915b7
9dbf9d9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a bit cleaner if entry_data was a
@dataclass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. We already discussed this previously here: #75037 (comment). I plan to implement this in a follow-up PR after this one is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need these two cases if the API always reports the temperature data in Celsius? The climate integration will convert between C and F for all the temperature attributes based on the climate entity
temperature_unit
attribute and the user globally configured temperature unit.The idea is that the platform shouldn't need to bother with converting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be pushed to
MazdaEntity
? That way each platform only needs to implement_update_state_attributes()
and not have to worry about callingsuper()
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea, but since it would affect several platforms, I would like to do this in a separate follow-up PR after this one is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit weird to call this method when there's no coordinator update. I'd create a different helper that we can call that calls
self._update_state_attributes
andself.async_write_ha_state
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be cleaner if you reversed the condition and returned early so you could outdent below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually did it this way because I couldn't find a way to achieve 100% test coverage otherwise. It doesn't seem possible to create a test scenario where
kwargs.get(ATTR_TEMPERATURE)
isNone
, but I need to check that case in order for the type checker to pass.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can make a service call for
set_temperature
that passes low and high target temps instead ofATTR_TEMPERATURE
.