DRY
github-actions opened this issue · comments
github-actions commented
DRY
sensor = [sensors for sensors in self.entities_get() if sensors[0] == sensor]
return sensor
def entities_delete(self, endpoint, data):
# TODO: DRY
session = sessions.BaseUrlSession(base_url=self.form_address())
session.headers = {"Authorization": f"Token {self._api_key}"}
delete = session.delete(f"{endpoint}/{data}/")
if not delete.ok:
_LOGGER.error(
"Cannot delete %s, check service fields",
endpoint,
)
152e51d6b1ddcd16f1319632da0410c8de9ff553
github-actions commented
Closed in 39dfcc6