Skip to content

Conversation

drc38
Copy link
Collaborator

@drc38 drc38 commented Aug 25, 2021

resolves #91, @lbbrhzn feel free to tweak further. Thanks for the help 👍

@drc38 drc38 requested a review from lbbrhzn August 25, 2021 11:36
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)
Copy link
Owner

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]
Copy link
Owner

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.

@lbbrhzn lbbrhzn merged commit 6431e0e into lbbrhzn:main Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting max current using sliders
2 participants