Skip to content

Commit

Permalink
Merge pull request #372 from henricm/capitalization
Browse files Browse the repository at this point in the history
fix: capitalization of sensors
  • Loading branch information
argoyle authored Jul 26, 2023
2 parents 7f7fe88 + d507162 commit 6b9e87b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
40 changes: 20 additions & 20 deletions custom_components/ferroamp/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
config_id,
),
ThreePhaseFerroampSensor(
"Inverter RMS current",
"Inverter RMS Current",
slug,
"il",
ELECTRIC_CURRENT_AMPERE,
Expand All @@ -1343,7 +1343,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
config_id,
),
SinglePhaseFerroampSensor(
"Inverter RMS current L1",
"Inverter RMS Current L1",
slug,
"il",
"L1",
Expand All @@ -1356,7 +1356,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
config_id,
),
SinglePhaseFerroampSensor(
"Inverter RMS current L2",
"Inverter RMS Current L2",
slug,
"il",
"L2",
Expand All @@ -1369,7 +1369,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
config_id,
),
SinglePhaseFerroampSensor(
"Inverter RMS current L3",
"Inverter RMS Current L3",
slug,
"il",
"L3",
Expand All @@ -1382,7 +1382,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
config_id,
),
ThreePhaseFerroampSensor(
"Inverter reactive current",
"Inverter Reactive Current",
slug,
"ild",
ELECTRIC_CURRENT_AMPERE,
Expand All @@ -1394,7 +1394,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
config_id,
),
SinglePhaseFerroampSensor(
"Inverter reactive current L1",
"Inverter Reactive Current L1",
slug,
"ild",
"L1",
Expand All @@ -1407,7 +1407,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
config_id,
),
SinglePhaseFerroampSensor(
"Inverter reactive current L2",
"Inverter Reactive Current L2",
slug,
"ild",
"L2",
Expand All @@ -1420,7 +1420,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
config_id,
),
SinglePhaseFerroampSensor(
"Inverter reactive current L3",
"Inverter Reactive Current L3",
slug,
"ild",
"L3",
Expand Down Expand Up @@ -1723,7 +1723,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
config_id,
),
ThreePhasePowerFerroampSensor(
"Inverter Power, active",
"Inverter Power, Active",
slug,
"pinv",
"mdi:solar-power",
Expand All @@ -1733,7 +1733,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
config_id,
),
SinglePhasePowerFerroampSensor(
"Inverter Power, active L1",
"Inverter Power, Active L1",
slug,
"pinv",
"L1",
Expand All @@ -1744,7 +1744,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
config_id,
),
SinglePhasePowerFerroampSensor(
"Inverter Power, active L2",
"Inverter Power, Active L2",
slug,
"pinv",
"L2",
Expand All @@ -1755,7 +1755,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
config_id,
),
SinglePhasePowerFerroampSensor(
"Inverter Power, active L3",
"Inverter Power, Active L3",
slug,
"pinv",
"L3",
Expand All @@ -1766,7 +1766,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
config_id,
),
ThreePhasePowerFerroampSensor(
"Inverter Power, reactive",
"Inverter Power, Reactive",
slug,
"pinvreactive",
"mdi:solar-power",
Expand All @@ -1776,7 +1776,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
config_id,
),
SinglePhasePowerFerroampSensor(
"Inverter Power, reactive L1",
"Inverter Power, Reactive L1",
slug,
"pinvreactive",
"L1",
Expand All @@ -1787,7 +1787,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
config_id,
),
SinglePhasePowerFerroampSensor(
"Inverter Power, reactive L2",
"Inverter Power, Reactive L2",
slug,
"pinvreactive",
"L2",
Expand All @@ -1798,7 +1798,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
config_id,
),
SinglePhasePowerFerroampSensor(
"Inverter Power, reactive L3",
"Inverter Power, Reactive L3",
slug,
"pinvreactive",
"L3",
Expand Down Expand Up @@ -2289,7 +2289,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
check_presence=True,
),
IntValFerroampSensor(
"Total rated capacity of all batteries",
"Total Rated Capacity of All Batteries",
slug,
"ratedcap",
UnitOfEnergy.WATT_HOUR,
Expand All @@ -2301,7 +2301,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
check_presence=True,
),
FloatValFerroampSensor(
"Available three phase active current for load balancing",
"Available Three Phase Active Current For Load Balancing",
slug,
"iavblq_3p",
ELECTRIC_CURRENT_AMPERE,
Expand All @@ -2315,7 +2315,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
check_presence=True,
),
ThreePhaseMinFerroampSensor(
"Available active current for load balancing",
"Available Active Current For Load Balancing",
slug,
"iavblq",
ELECTRIC_CURRENT_AMPERE,
Expand All @@ -2328,7 +2328,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
check_presence=True,
),
ThreePhaseMinFerroampSensor(
"Available RMS current for load balancing",
"Available RMS Current For Load Balancing",
slug,
"iavbl",
ELECTRIC_CURRENT_AMPERE,
Expand Down
22 changes: 11 additions & 11 deletions tests/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ async def test_setting_ehub_sensor_values_via_mqtt_message(hass, mqtt_mock):
'L2': 9.85,
'L3': 9.85,
'device_class': 'current',
'friendly_name': 'EnergyHub Inverter RMS current',
'friendly_name': 'EnergyHub Inverter RMS Current',
'icon': 'mdi:current-dc',
'state_class': 'measurement',
'unit_of_measurement': 'A'
Expand All @@ -164,7 +164,7 @@ async def test_setting_ehub_sensor_values_via_mqtt_message(hass, mqtt_mock):
assert state.state == "10"
assert state.attributes == {
'device_class': 'current',
'friendly_name': 'EnergyHub Inverter RMS current L1',
'friendly_name': 'EnergyHub Inverter RMS Current L1',
'icon': 'mdi:current-dc',
'state_class': 'measurement',
'unit_of_measurement': 'A'
Expand All @@ -174,7 +174,7 @@ async def test_setting_ehub_sensor_values_via_mqtt_message(hass, mqtt_mock):
assert state.state == "10"
assert state.attributes == {
'device_class': 'current',
'friendly_name': 'EnergyHub Inverter RMS current L2',
'friendly_name': 'EnergyHub Inverter RMS Current L2',
'icon': 'mdi:current-dc',
'state_class': 'measurement',
'unit_of_measurement': 'A'
Expand All @@ -184,7 +184,7 @@ async def test_setting_ehub_sensor_values_via_mqtt_message(hass, mqtt_mock):
assert state.state == "10"
assert state.attributes == {
'device_class': 'current',
'friendly_name': 'EnergyHub Inverter RMS current L3',
'friendly_name': 'EnergyHub Inverter RMS Current L3',
'icon': 'mdi:current-dc',
'state_class': 'measurement',
'unit_of_measurement': 'A'
Expand All @@ -197,7 +197,7 @@ async def test_setting_ehub_sensor_values_via_mqtt_message(hass, mqtt_mock):
'L2': 2.65,
'L3': 2.72,
'device_class': 'current',
'friendly_name': 'EnergyHub Inverter reactive current',
'friendly_name': 'EnergyHub Inverter Reactive Current',
'icon': 'mdi:current-dc',
'state_class': 'measurement',
'unit_of_measurement': 'A'
Expand Down Expand Up @@ -296,7 +296,7 @@ async def test_setting_ehub_sensor_values_via_mqtt_message(hass, mqtt_mock):
'L2': -2263.35,
'L3': -2234.62,
'device_class': 'power',
'friendly_name': 'EnergyHub Inverter Power, active',
'friendly_name': 'EnergyHub Inverter Power, Active',
'icon': 'mdi:solar-power',
'state_class': 'measurement',
'unit_of_measurement': 'W'
Expand All @@ -309,7 +309,7 @@ async def test_setting_ehub_sensor_values_via_mqtt_message(hass, mqtt_mock):
'L2': 438.12,
'L3': 444.64,
'device_class': 'power',
'friendly_name': 'EnergyHub Inverter Power, reactive',
'friendly_name': 'EnergyHub Inverter Power, Reactive',
'icon': 'mdi:solar-power',
'state_class': 'measurement',
'unit_of_measurement': 'W'
Expand Down Expand Up @@ -519,7 +519,7 @@ async def test_setting_ehub_sensor_values_via_mqtt_message(hass, mqtt_mock):
state = hass.states.get("sensor.ferroamp_total_rated_capacity_of_all_batteries")
assert state.state == "15300"
assert state.attributes == {
'friendly_name': 'EnergyHub Total rated capacity of all batteries',
'friendly_name': 'EnergyHub Total Rated Capacity of All Batteries',
'icon': 'mdi:battery',
'unit_of_measurement': 'Wh'
}
Expand All @@ -531,7 +531,7 @@ async def test_setting_ehub_sensor_values_via_mqtt_message(hass, mqtt_mock):
'L2': 29.05,
'L3': 33.93,
'device_class': 'current',
'friendly_name': 'EnergyHub Available active current for load balancing',
'friendly_name': 'EnergyHub Available Active Current For Load Balancing',
'icon': 'mdi:current-ac',
'state_class': 'measurement',
'unit_of_measurement': 'A'
Expand All @@ -544,7 +544,7 @@ async def test_setting_ehub_sensor_values_via_mqtt_message(hass, mqtt_mock):
'L2': 26.31,
'L3': 29.69,
'device_class': 'current',
'friendly_name': 'EnergyHub Available RMS current for load balancing',
'friendly_name': 'EnergyHub Available RMS Current For Load Balancing',
'icon': 'mdi:current-ac',
'state_class': 'measurement',
'unit_of_measurement': 'A'
Expand All @@ -554,7 +554,7 @@ async def test_setting_ehub_sensor_values_via_mqtt_message(hass, mqtt_mock):
assert state.state == "29"
assert state.attributes == {
'device_class': 'current',
'friendly_name': 'EnergyHub Available three phase active current for load balancing',
'friendly_name': 'EnergyHub Available Three Phase Active Current For Load Balancing',
'icon': 'mdi:current-ac',
'state_class': 'measurement',
'unit_of_measurement': 'A'
Expand Down

0 comments on commit 6b9e87b

Please sign in to comment.