Skip to content

Commit

Permalink
Add number domain for power_entity_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Marc Collin committed Aug 27, 2023
1 parent f912fa8 commit 90184a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions custom_components/solar_optimizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from homeassistant.components.input_boolean import DOMAIN as INPUT_BOOLEAN_DOMAIN
from homeassistant.components.input_number import DOMAIN as INPUT_NUMBER_DOMAIN
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.components.number import DOMAIN as NUMBER_DOMAIN

# from homeassistant.helpers.entity_component import EntityComponent

Expand Down Expand Up @@ -48,7 +48,7 @@
),
vol.Optional("power_entity_id"): selector.EntitySelector(
selector.EntitySelectorConfig(
domain=[INPUT_NUMBER_DOMAIN, SENSOR_DOMAIN]
domain=[INPUT_NUMBER_DOMAIN, NUMBER_DOMAIN]
)
),
vol.Required("power_max"): vol.Coerce(float),
Expand Down
4 changes: 3 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ def define_config_2_devices():
"action_mode": "event",
"convert_power_divide_factor": 6,
"change_power_service": "input_number/set_value",
"power_entity_id": "input_number.tesla_amps"
"power_entity_id": "input_number.tesla_amps",
"activation_service": "input_boolean/turn_on",
"deactivation_service": "input_boolean/turn_off"
}
],
}
Expand Down
2 changes: 2 additions & 0 deletions tests/test_nominal.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ async def test_normal_start_one_device(hass: HomeAssistant):
"duration_stop_min": 2,
"duration_power_min": 3,
"action_mode": "event",
"activation_service": "input_boolean/turn_on",
"deactivation_service": "input_boolean/turn_off",
"convert_power_divide_factor": 6,
"change_power_service": "input_number/set_value",
"power_entity_id": "input_number.tesla_amps"
Expand Down

0 comments on commit 90184a9

Please sign in to comment.