diff --git a/homeassistant/components/bsblan/sensor.py b/homeassistant/components/bsblan/sensor.py index 4091f5b0f00..72f3fbab2d0 100644 --- a/homeassistant/components/bsblan/sensor.py +++ b/homeassistant/components/bsblan/sensor.py @@ -64,6 +64,8 @@ SENSOR_TYPES: tuple[BSBLanSensorEntityDescription, ...] = ( device_class=SensorDeviceClass.ENERGY, native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR, state_class=SensorStateClass.TOTAL_INCREASING, + suggested_display_precision=0, + entity_registry_enabled_default=False, value_fn=lambda data: ( data.sensor.total_energy.value if data.sensor.total_energy is not None diff --git a/tests/components/bsblan/snapshots/test_sensor.ambr b/tests/components/bsblan/snapshots/test_sensor.ambr index 80f8a38ac0b..e8d128d3775 100644 --- a/tests/components/bsblan/snapshots/test_sensor.ambr +++ b/tests/components/bsblan/snapshots/test_sensor.ambr @@ -139,7 +139,7 @@ 'object_id_base': 'Total energy', 'options': dict({ 'sensor': dict({ - 'suggested_display_precision': 2, + 'suggested_display_precision': 0, }), }), 'original_device_class': , diff --git a/tests/components/bsblan/test_sensor.py b/tests/components/bsblan/test_sensor.py index 465e313b6b7..2eeedf90386 100644 --- a/tests/components/bsblan/test_sensor.py +++ b/tests/components/bsblan/test_sensor.py @@ -3,6 +3,7 @@ from unittest.mock import AsyncMock from freezegun.api import FrozenDateTimeFactory +import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.const import Platform @@ -18,6 +19,7 @@ ENTITY_OUTSIDE_TEMP = "sensor.bsb_lan_outside_temperature" ENTITY_TOTAL_ENERGY = "sensor.bsb_lan_total_energy" +@pytest.mark.usefixtures("entity_registry_enabled_by_default") async def test_sensor_entity_properties( hass: HomeAssistant, mock_bsblan: AsyncMock,