1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 20:35:55 +00:00

Remove geo ip (#586)

* Remove geo ip

* Update core.py

* Update dt.py
This commit is contained in:
Pascal Vizeli
2018-07-21 19:45:11 +02:00
committed by GitHub
parent fa9e20385e
commit e3ae48c8ff
2 changed files with 0 additions and 25 deletions

View File

@@ -7,7 +7,6 @@ from .coresys import CoreSysAttributes
from .const import (
STARTUP_SYSTEM, STARTUP_SERVICES, STARTUP_APPLICATION, STARTUP_INITIALIZE)
from .exceptions import HassioError
from .utils.dt import fetch_timezone
_LOGGER = logging.getLogger(__name__)
@@ -21,12 +20,6 @@ class HassIO(CoreSysAttributes):
async def setup(self):
"""Setup HassIO orchestration."""
# update timezone
if self.sys_config.timezone == 'UTC':
self.sys_config.timezone = \
await fetch_timezone(self.sys_websession)
self.sys_loop.call_soon(self.sys_config.save_data)
# Load Supervisor
await self.sys_supervisor.load()

View File

@@ -1,10 +1,8 @@
"""Tools file for HassIO."""
import asyncio
from datetime import datetime, timedelta, timezone
import logging
import re
import aiohttp
import pytz
UTC = pytz.utc
@@ -24,22 +22,6 @@ DATETIME_RE = re.compile(
)
async def fetch_timezone(websession):
"""Read timezone from freegeoip."""
data = {}
try:
async with websession.get(FREEGEOIP_URL, timeout=10) as request:
data = await request.json()
except (aiohttp.ClientError, asyncio.TimeoutError) as err:
_LOGGER.warning("Can't fetch freegeoip data: %s", err)
except ValueError as err:
_LOGGER.warning("Error on parse freegeoip data: %s", err)
return data.get('time_zone', 'UTC')
# Copyright (c) Django Software Foundation and individual contributors.
# All rights reserved.
# https://github.com/django/django/blob/master/LICENSE