Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
74a12bb8
Unverified
Commit
74a12bb8
authored
6 months ago
by
Yuxin Wang
Committed by
GitHub
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Replace LASTSTEST with LAST_S_TEST (#124668)
parent
51fd8e12
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
homeassistant/components/apcupsd/const.py
+1
-1
1 addition, 1 deletion
homeassistant/components/apcupsd/const.py
homeassistant/components/apcupsd/sensor.py
+4
-4
4 additions, 4 deletions
homeassistant/components/apcupsd/sensor.py
with
5 additions
and
5 deletions
homeassistant/components/apcupsd/const.py
+
1
−
1
View file @
74a12bb8
...
...
@@ -6,4 +6,4 @@ DOMAIN: Final = "apcupsd"
CONNECTION_TIMEOUT
:
int
=
10
# Field name of last self test retrieved from apcupsd.
LAST
S
TEST
:
Final
=
"
laststest
"
LAST
_S_
TEST
:
Final
=
"
laststest
"
This diff is collapsed.
Click to expand it.
homeassistant/components/apcupsd/sensor.py
+
4
−
4
View file @
74a12bb8
...
...
@@ -25,7 +25,7 @@ from homeassistant.core import HomeAssistant, callback
from
homeassistant.helpers.entity_platform
import
AddEntitiesCallback
from
homeassistant.helpers.update_coordinator
import
CoordinatorEntity
from
.const
import
DOMAIN
,
LAST
S
TEST
from
.const
import
DOMAIN
,
LAST
_S_
TEST
from
.coordinator
import
APCUPSdCoordinator
PARALLEL_UPDATES
=
0
...
...
@@ -156,8 +156,8 @@ SENSORS: dict[str, SensorEntityDescription] = {
device_class
=
SensorDeviceClass
.
TEMPERATURE
,
state_class
=
SensorStateClass
.
MEASUREMENT
,
),
LAST
S
TEST
:
SensorEntityDescription
(
key
=
LAST
S
TEST
,
LAST
_S_
TEST
:
SensorEntityDescription
(
key
=
LAST
_S_
TEST
,
translation_key
=
"
last_self_test
"
,
),
"
lastxfer
"
:
SensorEntityDescription
(
...
...
@@ -422,7 +422,7 @@ async def async_setup_entry(
# periodical (or manual) self test since last daemon restart. It might not be available
# when we set up the integration, and we do not know if it would ever be available. Here we
# add it anyway and mark it as unknown initially.
for
resource
in
available_resources
|
{
LAST
S
TEST
}:
for
resource
in
available_resources
|
{
LAST
_S_
TEST
}:
if
resource
not
in
SENSORS
:
_LOGGER
.
warning
(
"
Invalid resource from APCUPSd: %s
"
,
resource
.
upper
())
continue
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment