diff --git a/homeassistant/components/brother/sensor.py b/homeassistant/components/brother/sensor.py index 2768d0922fbf..21e46444c894 100644 --- a/homeassistant/components/brother/sensor.py +++ b/homeassistant/components/brother/sensor.py @@ -51,24 +51,28 @@ SENSOR_TYPES: tuple[BrotherSensorEntityDescription, ...] = ( key="page_counter", translation_key="page_counter", state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.page_counter, ), BrotherSensorEntityDescription( key="bw_counter", translation_key="bw_pages", state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.bw_counter, ), BrotherSensorEntityDescription( key="color_counter", translation_key="color_pages", state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.color_counter, ), BrotherSensorEntityDescription( key="duplex_unit_pages_counter", translation_key="duplex_unit_page_counter", state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.duplex_unit_pages_counter, ), BrotherSensorEntityDescription( @@ -76,18 +80,21 @@ SENSOR_TYPES: tuple[BrotherSensorEntityDescription, ...] = ( translation_key="drum_remaining_life", native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.drum_remaining_life, ), BrotherSensorEntityDescription( key="drum_remaining_pages", translation_key="drum_remaining_pages", state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.drum_remaining_pages, ), BrotherSensorEntityDescription( key="drum_counter", translation_key="drum_page_counter", state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.drum_counter, ), BrotherSensorEntityDescription( @@ -95,18 +102,21 @@ SENSOR_TYPES: tuple[BrotherSensorEntityDescription, ...] = ( translation_key="black_drum_remaining_life", native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.black_drum_remaining_life, ), BrotherSensorEntityDescription( key="black_drum_remaining_pages", translation_key="black_drum_remaining_pages", state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.black_drum_remaining_pages, ), BrotherSensorEntityDescription( key="black_drum_counter", translation_key="black_drum_page_counter", state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.black_drum_counter, ), BrotherSensorEntityDescription( @@ -114,18 +124,21 @@ SENSOR_TYPES: tuple[BrotherSensorEntityDescription, ...] = ( translation_key="cyan_drum_remaining_life", native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.cyan_drum_remaining_life, ), BrotherSensorEntityDescription( key="cyan_drum_remaining_pages", translation_key="cyan_drum_remaining_pages", state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.cyan_drum_remaining_pages, ), BrotherSensorEntityDescription( key="cyan_drum_counter", translation_key="cyan_drum_page_counter", state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.cyan_drum_counter, ), BrotherSensorEntityDescription( @@ -133,18 +146,21 @@ SENSOR_TYPES: tuple[BrotherSensorEntityDescription, ...] = ( translation_key="magenta_drum_remaining_life", native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.magenta_drum_remaining_life, ), BrotherSensorEntityDescription( key="magenta_drum_remaining_pages", translation_key="magenta_drum_remaining_pages", state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.magenta_drum_remaining_pages, ), BrotherSensorEntityDescription( key="magenta_drum_counter", translation_key="magenta_drum_page_counter", state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.magenta_drum_counter, ), BrotherSensorEntityDescription( @@ -152,18 +168,21 @@ SENSOR_TYPES: tuple[BrotherSensorEntityDescription, ...] = ( translation_key="yellow_drum_remaining_life", native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.yellow_drum_remaining_life, ), BrotherSensorEntityDescription( key="yellow_drum_remaining_pages", translation_key="yellow_drum_remaining_pages", state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.yellow_drum_remaining_pages, ), BrotherSensorEntityDescription( key="yellow_drum_counter", translation_key="yellow_drum_page_counter", state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.yellow_drum_counter, ), BrotherSensorEntityDescription( @@ -171,6 +190,7 @@ SENSOR_TYPES: tuple[BrotherSensorEntityDescription, ...] = ( translation_key="belt_unit_remaining_life", native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.belt_unit_remaining_life, ), BrotherSensorEntityDescription( @@ -178,6 +198,7 @@ SENSOR_TYPES: tuple[BrotherSensorEntityDescription, ...] = ( translation_key="fuser_remaining_life", native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.fuser_remaining_life, ), BrotherSensorEntityDescription( @@ -185,6 +206,7 @@ SENSOR_TYPES: tuple[BrotherSensorEntityDescription, ...] = ( translation_key="laser_remaining_life", native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.laser_remaining_life, ), BrotherSensorEntityDescription( @@ -192,6 +214,7 @@ SENSOR_TYPES: tuple[BrotherSensorEntityDescription, ...] = ( translation_key="pf_kit_1_remaining_life", native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.pf_kit_1_remaining_life, ), BrotherSensorEntityDescription( @@ -199,6 +222,7 @@ SENSOR_TYPES: tuple[BrotherSensorEntityDescription, ...] = ( translation_key="pf_kit_mp_remaining_life", native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, value=lambda data: data.pf_kit_mp_remaining_life, ), BrotherSensorEntityDescription( diff --git a/tests/components/brother/snapshots/test_sensor.ambr b/tests/components/brother/snapshots/test_sensor.ambr index 64b8a6cdcaec..877b22fccaa6 100644 --- a/tests/components/brother/snapshots/test_sensor.ambr +++ b/tests/components/brother/snapshots/test_sensor.ambr @@ -14,7 +14,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_b_w_pages', 'has_entity_name': True, 'hidden_by': None, @@ -68,7 +68,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_belt_unit_remaining_lifetime', 'has_entity_name': True, 'hidden_by': None, @@ -122,7 +122,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_black_drum_page_counter', 'has_entity_name': True, 'hidden_by': None, @@ -176,7 +176,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_black_drum_remaining_lifetime', 'has_entity_name': True, 'hidden_by': None, @@ -230,7 +230,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_black_drum_remaining_pages', 'has_entity_name': True, 'hidden_by': None, @@ -338,7 +338,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_color_pages', 'has_entity_name': True, 'hidden_by': None, @@ -392,7 +392,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_cyan_drum_page_counter', 'has_entity_name': True, 'hidden_by': None, @@ -446,7 +446,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_cyan_drum_remaining_lifetime', 'has_entity_name': True, 'hidden_by': None, @@ -500,7 +500,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_cyan_drum_remaining_pages', 'has_entity_name': True, 'hidden_by': None, @@ -608,7 +608,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_drum_page_counter', 'has_entity_name': True, 'hidden_by': None, @@ -662,7 +662,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_drum_remaining_lifetime', 'has_entity_name': True, 'hidden_by': None, @@ -716,7 +716,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_drum_remaining_pages', 'has_entity_name': True, 'hidden_by': None, @@ -770,7 +770,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_duplex_unit_page_counter', 'has_entity_name': True, 'hidden_by': None, @@ -824,7 +824,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_fuser_remaining_lifetime', 'has_entity_name': True, 'hidden_by': None, @@ -878,7 +878,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_magenta_drum_page_counter', 'has_entity_name': True, 'hidden_by': None, @@ -932,7 +932,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_magenta_drum_remaining_lifetime', 'has_entity_name': True, 'hidden_by': None, @@ -986,7 +986,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_magenta_drum_remaining_pages', 'has_entity_name': True, 'hidden_by': None, @@ -1094,7 +1094,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_page_counter', 'has_entity_name': True, 'hidden_by': None, @@ -1148,7 +1148,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_pf_kit_1_remaining_lifetime', 'has_entity_name': True, 'hidden_by': None, @@ -1303,7 +1303,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_yellow_drum_page_counter', 'has_entity_name': True, 'hidden_by': None, @@ -1357,7 +1357,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_yellow_drum_remaining_lifetime', 'has_entity_name': True, 'hidden_by': None, @@ -1411,7 +1411,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'sensor.hl_l2340dw_yellow_drum_remaining_pages', 'has_entity_name': True, 'hidden_by': None,