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
ca271250
Commit
ca271250
authored
6 years ago
by
Fabian Affolter
Committed by
Paulus Schoutsen
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update to hole to 0.3.0 (#15014)
parent
c871e8da
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/sensor/pi_hole.py
+6
-6
6 additions, 6 deletions
homeassistant/components/sensor/pi_hole.py
requirements_all.txt
+3
-3
3 additions, 3 deletions
requirements_all.txt
with
9 additions
and
9 deletions
homeassistant/components/sensor/pi_hole.py
+
6
−
6
View file @
ca271250
...
...
@@ -18,7 +18,7 @@ import homeassistant.helpers.config_validation as cv
from
homeassistant.helpers.entity
import
Entity
from
homeassistant.util
import
Throttle
REQUIREMENTS
=
[
'
pi
hole==0.
1.2
'
]
REQUIREMENTS
=
[
'
hole==0.
3.0
'
]
_LOGGER
=
logging
.
getLogger
(
__name__
)
...
...
@@ -65,7 +65,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol
.
Optional
(
CONF_LOCATION
,
default
=
DEFAULT_LOCATION
):
cv
.
string
,
vol
.
Optional
(
CONF_VERIFY_SSL
,
default
=
DEFAULT_VERIFY_SSL
):
cv
.
boolean
,
vol
.
Optional
(
CONF_MONITORED_CONDITIONS
,
default
=
list
(
MONITORED_CONDITIONS
)
):
default
=
[
'
ads_blocked_today
'
]
):
vol
.
All
(
cv
.
ensure_list
,
[
vol
.
In
(
MONITORED_CONDITIONS
)]),
})
...
...
@@ -73,7 +73,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
async
def
async_setup_platform
(
hass
,
config
,
async_add_devices
,
discovery_info
=
None
):
"""
Set up the Pi-hole sensor.
"""
from
pi
hole
import
Pi
Hole
from
hole
import
Hole
name
=
config
.
get
(
CONF_NAME
)
host
=
config
.
get
(
CONF_HOST
)
...
...
@@ -82,7 +82,7 @@ async def async_setup_platform(
verify_tls
=
config
.
get
(
CONF_VERIFY_SSL
)
session
=
async_get_clientsession
(
hass
)
pi_hole
=
PiHoleData
(
Pi
Hole
(
pi_hole
=
PiHoleData
(
Hole
(
host
,
hass
.
loop
,
session
,
location
=
location
,
tls
=
use_tls
,
verify_tls
=
verify_tls
))
...
...
@@ -164,11 +164,11 @@ class PiHoleData(object):
@Throttle
(
MIN_TIME_BETWEEN_UPDATES
)
async
def
async_update
(
self
):
"""
Get the latest data from the Pi-hole.
"""
from
pi
hole.exceptions
import
Pi
HoleError
from
hole.exceptions
import
HoleError
try
:
await
self
.
api
.
get_data
()
self
.
available
=
True
except
Pi
HoleError
:
except
HoleError
:
_LOGGER
.
error
(
"
Unable to fetch data from Pi-hole
"
)
self
.
available
=
False
This diff is collapsed.
Click to expand it.
requirements_all.txt
+
3
−
3
View file @
ca271250
...
...
@@ -406,6 +406,9 @@ hikvision==0.4
# homeassistant.components.notify.hipchat
hipnotify==1.0.8
# homeassistant.components.sensor.pi_hole
hole==0.3.0
# homeassistant.components.binary_sensor.workday
holidays==0.9.5
...
...
@@ -651,9 +654,6 @@ pifacedigitalio==3.0.5
# homeassistant.components.light.piglow
piglow==1.2.4
# homeassistant.components.sensor.pi_hole
pihole==0.1.2
# homeassistant.components.pilight
pilight==0.1.1
...
...
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