Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 13, 2023
1 parent 5fe9ef0 commit f913a73
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
1 change: 1 addition & 0 deletions custom_components/nyc311/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The NYC 311 Public Services Calendar integration."""

from __future__ import annotations

from datetime import timedelta
Expand Down
17 changes: 8 additions & 9 deletions custom_components/nyc311/base_device.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Base for NYC311 entities."""

from __future__ import annotations

from homeassistant.core import callback
Expand Down Expand Up @@ -52,15 +53,13 @@ def _handle_coordinator_update(self) -> None:

reason = self._calendar_entry.exception_reason

self._attr_extra_state_attributes.update(
{
"reason": reason if reason else None,
"description": self._calendar_entry.status_profile.description,
"status": self._calendar_entry.status_profile.standardized_type.name.title().replace(
"_", " "
),
}
)
self._attr_extra_state_attributes.update({
"reason": reason if reason else None,
"description": self._calendar_entry.status_profile.description,
"status": self._calendar_entry.status_profile.standardized_type.name.title().replace(
"_", " "
),
})

# If we use dict() here instead of a comprehension (as pylint requests), the dict won't actually sort.
self._attr_extra_state_attributes = (
Expand Down
13 changes: 6 additions & 7 deletions custom_components/nyc311/binary_sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Binary sensor API entity."""

from __future__ import annotations

from datetime import date, datetime
Expand Down Expand Up @@ -120,13 +121,11 @@ def update_device_data(self) -> None:
else:
closure_type = "Exception"

self._attr_extra_state_attributes.update(
{
"service_name": self._calendar_entry.service_profile.name,
"closure_type": closure_type,
"date": self._calendar_entry.date.isoformat(),
}
)
self._attr_extra_state_attributes.update({
"service_name": self._calendar_entry.service_profile.name,
"closure_type": closure_type,
"date": self._calendar_entry.date.isoformat(),
})

self._attr_is_on = (
self._calendar_entry.status_profile.standardized_type
Expand Down
1 change: 1 addition & 0 deletions custom_components/nyc311/calendar.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Binary sensor calendar entity."""

from __future__ import annotations

import datetime
Expand Down
1 change: 1 addition & 0 deletions custom_components/nyc311/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Config flow for NYC 311 Public Services Calendar integration."""

from __future__ import annotations

import logging
Expand Down
9 changes: 4 additions & 5 deletions custom_components/nyc311/sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Implements 'Next Exception' sensors."""

from __future__ import annotations

import logging
Expand Down Expand Up @@ -63,11 +64,9 @@ def update_device_data(self) -> None:
CalendarType.NEXT_EXCEPTIONS
][self._calendar_entry.service_profile.service_type]

self._attr_extra_state_attributes.update(
{
"closure_type": "Exception",
}
)
self._attr_extra_state_attributes.update({
"closure_type": "Exception",
})

self._attr_native_value = self._calendar_entry.date

Expand Down

0 comments on commit f913a73

Please sign in to comment.