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
c95f401e
Unverified
Commit
c95f401e
authored
4 years ago
by
tkdrob
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use core constants for nissan_leaf (#46401)
parent
ed31cc36
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
homeassistant/components/nissan_leaf/__init__.py
+1
-5
1 addition, 5 deletions
homeassistant/components/nissan_leaf/__init__.py
with
1 addition
and
5 deletions
homeassistant/components/nissan_leaf/__init__.py
+
1
−
5
View file @
c95f401e
...
@@ -7,7 +7,7 @@ import sys
...
@@ -7,7 +7,7 @@ import sys
from
pycarwings2
import
CarwingsError
,
Session
from
pycarwings2
import
CarwingsError
,
Session
import
voluptuous
as
vol
import
voluptuous
as
vol
from
homeassistant.const
import
CONF_PASSWORD
,
CONF_USERNAME
,
HTTP_OK
from
homeassistant.const
import
CONF_PASSWORD
,
CONF_REGION
,
CONF_USERNAME
,
HTTP_OK
from
homeassistant.core
import
callback
from
homeassistant.core
import
callback
import
homeassistant.helpers.config_validation
as
cv
import
homeassistant.helpers.config_validation
as
cv
from
homeassistant.helpers.discovery
import
load_platform
from
homeassistant.helpers.discovery
import
load_platform
...
@@ -34,7 +34,6 @@ DATA_RANGE_AC_OFF = "range_ac_off"
...
@@ -34,7 +34,6 @@ DATA_RANGE_AC_OFF = "range_ac_off"
CONF_INTERVAL
=
"
update_interval
"
CONF_INTERVAL
=
"
update_interval
"
CONF_CHARGING_INTERVAL
=
"
update_interval_charging
"
CONF_CHARGING_INTERVAL
=
"
update_interval_charging
"
CONF_CLIMATE_INTERVAL
=
"
update_interval_climate
"
CONF_CLIMATE_INTERVAL
=
"
update_interval_climate
"
CONF_REGION
=
"
region
"
CONF_VALID_REGIONS
=
[
"
NNA
"
,
"
NE
"
,
"
NCI
"
,
"
NMA
"
,
"
NML
"
]
CONF_VALID_REGIONS
=
[
"
NNA
"
,
"
NE
"
,
"
NCI
"
,
"
NMA
"
,
"
NML
"
]
CONF_FORCE_MILES
=
"
force_miles
"
CONF_FORCE_MILES
=
"
force_miles
"
...
@@ -272,7 +271,6 @@ class LeafDataStore:
...
@@ -272,7 +271,6 @@ class LeafDataStore:
async
def
async_refresh_data
(
self
,
now
):
async
def
async_refresh_data
(
self
,
now
):
"""
Refresh the leaf data and update the datastore.
"""
"""
Refresh the leaf data and update the datastore.
"""
if
self
.
request_in_progress
:
if
self
.
request_in_progress
:
_LOGGER
.
debug
(
"
Refresh currently in progress for %s
"
,
self
.
leaf
.
nickname
)
_LOGGER
.
debug
(
"
Refresh currently in progress for %s
"
,
self
.
leaf
.
nickname
)
return
return
...
@@ -336,7 +334,6 @@ class LeafDataStore:
...
@@ -336,7 +334,6 @@ class LeafDataStore:
async
def
async_get_battery
(
self
):
async
def
async_get_battery
(
self
):
"""
Request battery update from Nissan servers.
"""
"""
Request battery update from Nissan servers.
"""
try
:
try
:
# Request battery update from the car
# Request battery update from the car
_LOGGER
.
debug
(
"
Requesting battery update, %s
"
,
self
.
leaf
.
vin
)
_LOGGER
.
debug
(
"
Requesting battery update, %s
"
,
self
.
leaf
.
vin
)
...
@@ -388,7 +385,6 @@ class LeafDataStore:
...
@@ -388,7 +385,6 @@ class LeafDataStore:
async
def
async_get_climate
(
self
):
async
def
async_get_climate
(
self
):
"""
Request climate data from Nissan servers.
"""
"""
Request climate data from Nissan servers.
"""
try
:
try
:
return
await
self
.
hass
.
async_add_executor_job
(
return
await
self
.
hass
.
async_add_executor_job
(
self
.
leaf
.
get_latest_hvac_status
self
.
leaf
.
get_latest_hvac_status
...
...
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