mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 01:38:02 +00:00
Remove Epson Workforce integration (#115201)
* Remove Epson Workforce integration * Remove Epson Workforce integration
This commit is contained in:
parent
bf3eb463ae
commit
80450adb1a
@ -365,7 +365,6 @@ omit =
|
||||
homeassistant/components/epion/sensor.py
|
||||
homeassistant/components/epson/__init__.py
|
||||
homeassistant/components/epson/media_player.py
|
||||
homeassistant/components/epsonworkforce/sensor.py
|
||||
homeassistant/components/eq3btsmart/__init__.py
|
||||
homeassistant/components/eq3btsmart/climate.py
|
||||
homeassistant/components/eq3btsmart/const.py
|
||||
|
@ -399,7 +399,6 @@ build.json @home-assistant/supervisor
|
||||
/tests/components/epion/ @lhgravendeel
|
||||
/homeassistant/components/epson/ @pszafer
|
||||
/tests/components/epson/ @pszafer
|
||||
/homeassistant/components/epsonworkforce/ @ThaStealth
|
||||
/homeassistant/components/eq3btsmart/ @eulemitkeule @dbuezas
|
||||
/tests/components/eq3btsmart/ @eulemitkeule @dbuezas
|
||||
/homeassistant/components/escea/ @lazdavila
|
||||
|
@ -1,5 +0,0 @@
|
||||
{
|
||||
"domain": "epson",
|
||||
"name": "Epson",
|
||||
"integrations": ["epson", "epsonworkforce"]
|
||||
}
|
@ -1 +0,0 @@
|
||||
"""The epsonworkforce component."""
|
@ -1,9 +0,0 @@
|
||||
{
|
||||
"domain": "epsonworkforce",
|
||||
"name": "Epson Workforce",
|
||||
"codeowners": ["@ThaStealth"],
|
||||
"documentation": "https://www.home-assistant.io/integrations/epsonworkforce",
|
||||
"iot_class": "local_polling",
|
||||
"loggers": ["epsonprinter_pkg"],
|
||||
"requirements": ["epsonprinter==0.0.9"]
|
||||
}
|
@ -1,117 +0,0 @@
|
||||
"""Support for Epson Workforce Printer."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import timedelta
|
||||
|
||||
from epsonprinter_pkg.epsonprinterapi import EpsonPrinterAPI
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
PLATFORM_SCHEMA,
|
||||
SensorEntity,
|
||||
SensorEntityDescription,
|
||||
)
|
||||
from homeassistant.const import CONF_HOST, CONF_MONITORED_CONDITIONS, PERCENTAGE
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||
SensorEntityDescription(
|
||||
key="black",
|
||||
name="Ink level Black",
|
||||
icon="mdi:water",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="photoblack",
|
||||
name="Ink level Photoblack",
|
||||
icon="mdi:water",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="magenta",
|
||||
name="Ink level Magenta",
|
||||
icon="mdi:water",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="cyan",
|
||||
name="Ink level Cyan",
|
||||
icon="mdi:water",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="yellow",
|
||||
name="Ink level Yellow",
|
||||
icon="mdi:water",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="clean",
|
||||
name="Cleaning level",
|
||||
icon="mdi:water",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
),
|
||||
)
|
||||
MONITORED_CONDITIONS: list[str] = [desc.key for desc in SENSOR_TYPES]
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_HOST): cv.string,
|
||||
vol.Required(CONF_MONITORED_CONDITIONS): vol.All(
|
||||
cv.ensure_list, [vol.In(MONITORED_CONDITIONS)]
|
||||
),
|
||||
}
|
||||
)
|
||||
SCAN_INTERVAL = timedelta(minutes=60)
|
||||
|
||||
|
||||
def setup_platform(
|
||||
hass: HomeAssistant,
|
||||
config: ConfigType,
|
||||
add_devices: AddEntitiesCallback,
|
||||
discovery_info: DiscoveryInfoType | None = None,
|
||||
) -> None:
|
||||
"""Set up the cartridge sensor."""
|
||||
host = config.get(CONF_HOST)
|
||||
|
||||
api = EpsonPrinterAPI(host)
|
||||
if not api.available:
|
||||
raise PlatformNotReady
|
||||
|
||||
sensors = [
|
||||
EpsonPrinterCartridge(api, description)
|
||||
for description in SENSOR_TYPES
|
||||
if description.key in config[CONF_MONITORED_CONDITIONS]
|
||||
]
|
||||
|
||||
add_devices(sensors, True)
|
||||
|
||||
|
||||
class EpsonPrinterCartridge(SensorEntity):
|
||||
"""Representation of a cartridge sensor."""
|
||||
|
||||
def __init__(
|
||||
self, api: EpsonPrinterAPI, description: SensorEntityDescription
|
||||
) -> None:
|
||||
"""Initialize a cartridge sensor."""
|
||||
self._api = api
|
||||
self.entity_description = description
|
||||
|
||||
@property
|
||||
def native_value(self):
|
||||
"""Return the state of the device."""
|
||||
return self._api.getSensorValue(self.entity_description.key)
|
||||
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
"""Could the device be accessed during the last update call."""
|
||||
return self._api.available
|
||||
|
||||
def update(self) -> None:
|
||||
"""Get the latest data from the Epson printer."""
|
||||
self._api.update()
|
@ -1650,20 +1650,9 @@
|
||||
},
|
||||
"epson": {
|
||||
"name": "Epson",
|
||||
"integrations": {
|
||||
"epson": {
|
||||
"integration_type": "hub",
|
||||
"config_flow": true,
|
||||
"iot_class": "local_polling",
|
||||
"name": "Epson"
|
||||
},
|
||||
"epsonworkforce": {
|
||||
"integration_type": "hub",
|
||||
"config_flow": false,
|
||||
"iot_class": "local_polling",
|
||||
"name": "Epson Workforce"
|
||||
}
|
||||
}
|
||||
"integration_type": "hub",
|
||||
"config_flow": true,
|
||||
"iot_class": "local_polling"
|
||||
},
|
||||
"eq3": {
|
||||
"name": "eQ-3",
|
||||
|
@ -821,9 +821,6 @@ epion==0.0.3
|
||||
# homeassistant.components.epson
|
||||
epson-projector==0.5.1
|
||||
|
||||
# homeassistant.components.epsonworkforce
|
||||
epsonprinter==0.0.9
|
||||
|
||||
# homeassistant.components.eq3btsmart
|
||||
eq3btsmart==1.1.6
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user