diff --git a/homeassistant/components/onedrive/sensor.py b/homeassistant/components/onedrive/sensor.py index 35c59d0c644..0ca2b166e3f 100644 --- a/homeassistant/components/onedrive/sensor.py +++ b/homeassistant/components/onedrive/sensor.py @@ -36,7 +36,7 @@ DRIVE_STATE_ENTITIES: tuple[OneDriveSensorEntityDescription, ...] = ( key="total_size", value_fn=lambda quota: quota.total, native_unit_of_measurement=UnitOfInformation.BYTES, - suggested_unit_of_measurement=UnitOfInformation.GIGABYTES, + suggested_unit_of_measurement=UnitOfInformation.GIBIBYTES, suggested_display_precision=0, device_class=SensorDeviceClass.DATA_SIZE, entity_category=EntityCategory.DIAGNOSTIC, @@ -46,7 +46,7 @@ DRIVE_STATE_ENTITIES: tuple[OneDriveSensorEntityDescription, ...] = ( key="used_size", value_fn=lambda quota: quota.used, native_unit_of_measurement=UnitOfInformation.BYTES, - suggested_unit_of_measurement=UnitOfInformation.GIGABYTES, + suggested_unit_of_measurement=UnitOfInformation.GIBIBYTES, suggested_display_precision=2, device_class=SensorDeviceClass.DATA_SIZE, entity_category=EntityCategory.DIAGNOSTIC, @@ -55,7 +55,7 @@ DRIVE_STATE_ENTITIES: tuple[OneDriveSensorEntityDescription, ...] = ( key="remaining_size", value_fn=lambda quota: quota.remaining, native_unit_of_measurement=UnitOfInformation.BYTES, - suggested_unit_of_measurement=UnitOfInformation.GIGABYTES, + suggested_unit_of_measurement=UnitOfInformation.GIBIBYTES, suggested_display_precision=2, device_class=SensorDeviceClass.DATA_SIZE, entity_category=EntityCategory.DIAGNOSTIC, diff --git a/homeassistant/components/onedrive/strings.json b/homeassistant/components/onedrive/strings.json index 3a9f6d06594..20d139a4bc0 100644 --- a/homeassistant/components/onedrive/strings.json +++ b/homeassistant/components/onedrive/strings.json @@ -32,11 +32,11 @@ "issues": { "drive_full": { "title": "OneDrive data cap exceeded", - "description": "Your OneDrive has exceeded your quota limit. This means your next backup will fail. Please free up some space or upgrade your OneDrive plan. Currently using {used} GB of {total} GB." + "description": "Your OneDrive has exceeded your quota limit. This means your next backup will fail. Please free up some space or upgrade your OneDrive plan. Currently using {used} GiB of {total} GiB." }, "drive_almost_full": { "title": "OneDrive near data cap", - "description": "Your OneDrive is near your quota limit. If you go over this limit your drive will be temporarily frozen and your backups will start failing. Please free up some space or upgrade your OneDrive plan. Currently using {used} GB of {total} GB." + "description": "Your OneDrive is near your quota limit. If you go over this limit your drive will be temporarily frozen and your backups will start failing. Please free up some space or upgrade your OneDrive plan. Currently using {used} GiB of {total} GiB." } }, "exceptions": { diff --git a/tests/components/onedrive/const.py b/tests/components/onedrive/const.py index 44f50aa625d..0c04a6f4c82 100644 --- a/tests/components/onedrive/const.py +++ b/tests/components/onedrive/const.py @@ -110,9 +110,9 @@ MOCK_DRIVE = Drive( owner=IDENTITY_SET, quota=DriveQuota( deleted=5, - remaining=750000000, + remaining=805306368, state=DriveState.NEARING, - total=5000000000, + total=5368709120, used=4250000000, ), ) diff --git a/tests/components/onedrive/snapshots/test_sensor.ambr b/tests/components/onedrive/snapshots/test_sensor.ambr index 43c6921b0e5..742c069f206 100644 --- a/tests/components/onedrive/snapshots/test_sensor.ambr +++ b/tests/components/onedrive/snapshots/test_sensor.ambr @@ -86,7 +86,7 @@ 'suggested_display_precision': 2, }), 'sensor.private': dict({ - 'suggested_unit_of_measurement': , + 'suggested_unit_of_measurement': , }), }), 'original_device_class': , @@ -97,7 +97,7 @@ 'supported_features': 0, 'translation_key': 'remaining_size', 'unique_id': 'mock_drive_id_remaining_size', - 'unit_of_measurement': , + 'unit_of_measurement': , }) # --- # name: test_sensors[sensor.my_drive_remaining_storage-state] @@ -105,7 +105,7 @@ 'attributes': ReadOnlyDict({ 'device_class': 'data_size', 'friendly_name': 'My Drive Remaining storage', - 'unit_of_measurement': , + 'unit_of_measurement': , }), 'context': , 'entity_id': 'sensor.my_drive_remaining_storage', @@ -141,7 +141,7 @@ 'suggested_display_precision': 0, }), 'sensor.private': dict({ - 'suggested_unit_of_measurement': , + 'suggested_unit_of_measurement': , }), }), 'original_device_class': , @@ -152,7 +152,7 @@ 'supported_features': 0, 'translation_key': 'total_size', 'unique_id': 'mock_drive_id_total_size', - 'unit_of_measurement': , + 'unit_of_measurement': , }) # --- # name: test_sensors[sensor.my_drive_total_available_storage-state] @@ -160,7 +160,7 @@ 'attributes': ReadOnlyDict({ 'device_class': 'data_size', 'friendly_name': 'My Drive Total available storage', - 'unit_of_measurement': , + 'unit_of_measurement': , }), 'context': , 'entity_id': 'sensor.my_drive_total_available_storage', @@ -196,7 +196,7 @@ 'suggested_display_precision': 2, }), 'sensor.private': dict({ - 'suggested_unit_of_measurement': , + 'suggested_unit_of_measurement': , }), }), 'original_device_class': , @@ -207,7 +207,7 @@ 'supported_features': 0, 'translation_key': 'used_size', 'unique_id': 'mock_drive_id_used_size', - 'unit_of_measurement': , + 'unit_of_measurement': , }) # --- # name: test_sensors[sensor.my_drive_used_storage-state] @@ -215,13 +215,13 @@ 'attributes': ReadOnlyDict({ 'device_class': 'data_size', 'friendly_name': 'My Drive Used storage', - 'unit_of_measurement': , + 'unit_of_measurement': , }), 'context': , 'entity_id': 'sensor.my_drive_used_storage', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '4.25', + 'state': '3.95812094211578', }) # ---