diff --git a/homeassistant/components/syncthru/__init__.py b/homeassistant/components/syncthru/__init__.py index 988c92de593..5031f485ab3 100644 --- a/homeassistant/components/syncthru/__init__.py +++ b/homeassistant/components/syncthru/__init__.py @@ -69,6 +69,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: config_entry_id=entry.entry_id, configuration_url=printer.url, connections=device_connections(printer), + default_manufacturer="Samsung", identifiers=device_identifiers(printer), model=printer.model(), name=printer.hostname(), diff --git a/homeassistant/components/syncthru/sensor.py b/homeassistant/components/syncthru/sensor.py index 788b1cb5761..11e1403816e 100644 --- a/homeassistant/components/syncthru/sensor.py +++ b/homeassistant/components/syncthru/sensor.py @@ -55,7 +55,10 @@ async def async_setup_entry( supp_output_tray = printer.output_tray_status() name = config_entry.data[CONF_NAME] - entities: list[SyncThruSensor] = [SyncThruMainSensor(coordinator, name)] + entities: list[SyncThruSensor] = [ + SyncThruMainSensor(coordinator, name), + SyncThruActiveAlertSensor(coordinator, name), + ] for key in supp_toner: entities.append(SyncThruTonerSensor(coordinator, name, key)) @@ -166,7 +169,7 @@ class SyncThruTonerSensor(SyncThruSensor): class SyncThruDrumSensor(SyncThruSensor): - """Implementation of a Samsung Printer toner sensor platform.""" + """Implementation of a Samsung Printer drum sensor platform.""" def __init__(self, syncthru, name, color): """Initialize the sensor.""" @@ -214,7 +217,7 @@ class SyncThruInputTraySensor(SyncThruSensor): class SyncThruOutputTraySensor(SyncThruSensor): - """Implementation of a Samsung Printer input tray sensor platform.""" + """Implementation of a Samsung Printer output tray sensor platform.""" def __init__(self, syncthru, name, number): """Initialize the sensor.""" @@ -237,3 +240,18 @@ class SyncThruOutputTraySensor(SyncThruSensor): if tray_state == "": tray_state = "Ready" return tray_state + + +class SyncThruActiveAlertSensor(SyncThruSensor): + """Implementation of a Samsung Printer active alerts sensor platform.""" + + def __init__(self, syncthru, name): + """Initialize the sensor.""" + super().__init__(syncthru, name) + self._name = f"{name} Active Alerts" + self._id_suffix = "_active_alerts" + + @property + def native_value(self): + """Show number of active alerts.""" + return self.syncthru.raw().get("GXI_ACTIVE_ALERT_TOTAL")