-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Add support for Matter EVSE devicetype #137189
base: dev
Are you sure you want to change the base?
Conversation
Hey there @home-assistant/matter, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
@pytest.mark.parametrize("node_fixture", ["silabs_evse_charging"]) | ||
async def test_evse_sensor( | ||
hass: HomeAssistant, | ||
matter_client: MagicMock, | ||
matter_node: MatterNode, | ||
) -> None: | ||
"""Test evse sensors.""" | ||
entity_id = "binary_sensor.evse_charging_status" | ||
state = hass.states.get(entity_id) | ||
assert state | ||
assert state.state == "on" | ||
# switch to PluggedInDemand state | ||
set_node_attribute(matter_node, 1, 153, 0, 2) | ||
await trigger_subscription_callback( | ||
hass, matter_client, data=(matter_node.node_id, "1/153/0", 2) | ||
) | ||
state = hass.states.get(entity_id) | ||
assert state | ||
assert state.state == "off" | ||
|
||
# binary_sensor.evse_plug | ||
state = hass.states.get("binary_sensor.evse_plug") | ||
assert state | ||
assert state.state == "on" | ||
# switch to NotPluggedIn state | ||
set_node_attribute(matter_node, 1, 153, 0, 0) | ||
await trigger_subscription_callback( | ||
hass, matter_client, data=(matter_node.node_id, "1/153/0", 0) | ||
) | ||
state = hass.states.get(entity_id) | ||
assert state | ||
assert state.state == "off" | ||
|
||
# binary_sensor.evse_supply_charging_state | ||
state = hass.states.get("binary_sensor.evse_supply_charging_state") | ||
assert state | ||
assert state.state == "on" | ||
# switch to Disabled state | ||
set_node_attribute(matter_node, 1, 153, 0, 0) | ||
await trigger_subscription_callback( | ||
hass, matter_client, data=(matter_node.node_id, "1/153/1", 0) | ||
) |
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.
If this is using an existing sensor class that already has tests for the generic behavior, this does not need explicit extra tests and the snapshot testing is sufficient. It doesn't harm either.
Will leave this up to @joostlek
Proposed change
Support for Matter EVSE - EnergyEvse cluster
Matter 1.3’s energy features enable new energy-centric devices, the first of which is Electric Vehicle Supply Equipment (EVSE).
I was asked to replace the buttons with a switch in the PR#133662.
As discussed with Marcel, the second step would be to create a specific entity for EVSE in Home Assistant for better integration.
Type of change
Additional information
Changes
Add
command_timeout attribute
inMatterGenericCommandSwitch
class. This is mandatory forEnergyEvse
commands.Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: