Skip to content

Commit

Permalink
Remove native_unit_of_measurement from Onewire counters (home-assista…
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieger authored Dec 6, 2024
1 parent 3fb1b8e commit 4fe8a43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion homeassistant/components/onewire/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ def _get_sensor_precision_family_28(device_id: str, options: Mapping[str, Any])
"1D": tuple(
OneWireSensorEntityDescription(
key=f"counter.{device_key}",
native_unit_of_measurement="count",
read_mode=READ_MODE_INT,
state_class=SensorStateClass.TOTAL_INCREASING,
translation_key="counter_id",
Expand Down
12 changes: 4 additions & 8 deletions tests/components/onewire/snapshots/test_sensor.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@
'supported_features': 0,
'translation_key': 'counter_id',
'unique_id': '/1D.111111111111/counter.A',
'unit_of_measurement': 'count',
'unit_of_measurement': None,
}),
EntityRegistryEntrySnapshot({
'aliases': set({
Expand Down Expand Up @@ -396,7 +396,7 @@
'supported_features': 0,
'translation_key': 'counter_id',
'unique_id': '/1D.111111111111/counter.B',
'unit_of_measurement': 'count',
'unit_of_measurement': None,
}),
])
# ---
Expand All @@ -408,7 +408,6 @@
'friendly_name': '1D.111111111111 Counter A',
'raw_value': 251123.0,
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
'unit_of_measurement': 'count',
}),
'context': <ANY>,
'entity_id': 'sensor.1d_111111111111_counter_a',
Expand All @@ -423,7 +422,6 @@
'friendly_name': '1D.111111111111 Counter B',
'raw_value': 248125.0,
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
'unit_of_measurement': 'count',
}),
'context': <ANY>,
'entity_id': 'sensor.1d_111111111111_counter_b',
Expand Down Expand Up @@ -531,7 +529,7 @@
'supported_features': 0,
'translation_key': 'counter_id',
'unique_id': '/1D.111111111111/counter.A',
'unit_of_measurement': 'count',
'unit_of_measurement': None,
}),
EntityRegistryEntrySnapshot({
'aliases': set({
Expand Down Expand Up @@ -564,7 +562,7 @@
'supported_features': 0,
'translation_key': 'counter_id',
'unique_id': '/1D.111111111111/counter.B',
'unit_of_measurement': 'count',
'unit_of_measurement': None,
}),
])
# ---
Expand All @@ -576,7 +574,6 @@
'friendly_name': '1D.111111111111 Counter A',
'raw_value': 251123.0,
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
'unit_of_measurement': 'count',
}),
'context': <ANY>,
'entity_id': 'sensor.1d_111111111111_counter_a',
Expand All @@ -591,7 +588,6 @@
'friendly_name': '1D.111111111111 Counter B',
'raw_value': 248125.0,
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
'unit_of_measurement': 'count',
}),
'context': <ANY>,
'entity_id': 'sensor.1d_111111111111_counter_b',
Expand Down

0 comments on commit 4fe8a43

Please sign in to comment.