mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Update to hole to 0.3.0 (#15014)
This commit is contained in:
parent
c871e8da5d
commit
ca2712506b
@ -18,7 +18,7 @@ import homeassistant.helpers.config_validation as cv
|
|||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
REQUIREMENTS = ['pihole==0.1.2']
|
REQUIREMENTS = ['hole==0.3.0']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_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_LOCATION, default=DEFAULT_LOCATION): cv.string,
|
||||||
vol.Optional(CONF_VERIFY_SSL, default=DEFAULT_VERIFY_SSL): cv.boolean,
|
vol.Optional(CONF_VERIFY_SSL, default=DEFAULT_VERIFY_SSL): cv.boolean,
|
||||||
vol.Optional(CONF_MONITORED_CONDITIONS,
|
vol.Optional(CONF_MONITORED_CONDITIONS,
|
||||||
default=list(MONITORED_CONDITIONS)):
|
default=['ads_blocked_today']):
|
||||||
vol.All(cv.ensure_list, [vol.In(MONITORED_CONDITIONS)]),
|
vol.All(cv.ensure_list, [vol.In(MONITORED_CONDITIONS)]),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||||||
async def async_setup_platform(
|
async def async_setup_platform(
|
||||||
hass, config, async_add_devices, discovery_info=None):
|
hass, config, async_add_devices, discovery_info=None):
|
||||||
"""Set up the Pi-hole sensor."""
|
"""Set up the Pi-hole sensor."""
|
||||||
from pihole import PiHole
|
from hole import Hole
|
||||||
|
|
||||||
name = config.get(CONF_NAME)
|
name = config.get(CONF_NAME)
|
||||||
host = config.get(CONF_HOST)
|
host = config.get(CONF_HOST)
|
||||||
@ -82,7 +82,7 @@ async def async_setup_platform(
|
|||||||
verify_tls = config.get(CONF_VERIFY_SSL)
|
verify_tls = config.get(CONF_VERIFY_SSL)
|
||||||
|
|
||||||
session = async_get_clientsession(hass)
|
session = async_get_clientsession(hass)
|
||||||
pi_hole = PiHoleData(PiHole(
|
pi_hole = PiHoleData(Hole(
|
||||||
host, hass.loop, session, location=location, tls=use_tls,
|
host, hass.loop, session, location=location, tls=use_tls,
|
||||||
verify_tls=verify_tls))
|
verify_tls=verify_tls))
|
||||||
|
|
||||||
@ -164,11 +164,11 @@ class PiHoleData(object):
|
|||||||
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
||||||
async def async_update(self):
|
async def async_update(self):
|
||||||
"""Get the latest data from the Pi-hole."""
|
"""Get the latest data from the Pi-hole."""
|
||||||
from pihole.exceptions import PiHoleError
|
from hole.exceptions import HoleError
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await self.api.get_data()
|
await self.api.get_data()
|
||||||
self.available = True
|
self.available = True
|
||||||
except PiHoleError:
|
except HoleError:
|
||||||
_LOGGER.error("Unable to fetch data from Pi-hole")
|
_LOGGER.error("Unable to fetch data from Pi-hole")
|
||||||
self.available = False
|
self.available = False
|
||||||
|
@ -406,6 +406,9 @@ hikvision==0.4
|
|||||||
# homeassistant.components.notify.hipchat
|
# homeassistant.components.notify.hipchat
|
||||||
hipnotify==1.0.8
|
hipnotify==1.0.8
|
||||||
|
|
||||||
|
# homeassistant.components.sensor.pi_hole
|
||||||
|
hole==0.3.0
|
||||||
|
|
||||||
# homeassistant.components.binary_sensor.workday
|
# homeassistant.components.binary_sensor.workday
|
||||||
holidays==0.9.5
|
holidays==0.9.5
|
||||||
|
|
||||||
@ -651,9 +654,6 @@ pifacedigitalio==3.0.5
|
|||||||
# homeassistant.components.light.piglow
|
# homeassistant.components.light.piglow
|
||||||
piglow==1.2.4
|
piglow==1.2.4
|
||||||
|
|
||||||
# homeassistant.components.sensor.pi_hole
|
|
||||||
pihole==0.1.2
|
|
||||||
|
|
||||||
# homeassistant.components.pilight
|
# homeassistant.components.pilight
|
||||||
pilight==0.1.1
|
pilight==0.1.1
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user