-
-
Notifications
You must be signed in to change notification settings - Fork 101
Add number platform using slider (input_number) #124
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fetch upstream
Metric class
Supported features
f"Invalid value for {self.entity_id}: {value} (range {self._minimum} - {self._maximum})" | ||
) | ||
|
||
resp = await self.central_system.set_max_charge_rate_amps(self.cp_id, num_value) |
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.
would be nice to make the service call parameterizable. Maybe hook it up to a Metric, and let the charger subscribe to notifications? I guess the Number entity should also subscribe to the Metric, to make the slider revert to the previous value if the new value cannot be set.
@property | ||
def available(self) -> bool: | ||
"""Return if switch is available.""" | ||
return self.central_system.get_available(self.cp_id) # type: ignore [no-any-return] |
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 will disable the slider when the charge point is not available. From usability point of view it would be nice if you could set the slider value when then charge point is not available. They should then be applied on (re-)connect. I think this should be possible by connecting to a Metric.
resolves #91, @lbbrhzn feel free to tweak further. Thanks for the help 👍