Skip to content

Commit

Permalink
remove yaml initiation from const
Browse files Browse the repository at this point in the history
  • Loading branch information
rgerbranda committed Mar 14, 2024
1 parent 6916db1 commit 09e6bfe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
4 changes: 2 additions & 2 deletions custom_components/rbfa/API.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ async def update(self):
# matchdata['awayteamposition'] = rankpos['away']

upcoming = True
self.matchdata = {'upcoming': previous, 'lastmatch': previous}
self.matchdata = {'upcoming': matchdata, 'lastmatch': previous}


summary = '[' + item['state'] + '] ' + item['homeTeam']['name'] + ' - ' + item['awayTeam']['name']
Expand All @@ -179,4 +179,4 @@ async def update(self):

if not upcoming:
_LOGGER.debug('previous=last')
self.matchdata['lastmatch'] = previous
self.matchdata['lastmatch'] = previous
5 changes: 2 additions & 3 deletions custom_components/rbfa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
from homeassistant.const import Platform

from homeassistant.core import HomeAssistant
from homeassistant.helpers.typing import ConfigType
#from homeassistant.helpers.typing import ConfigType
from homeassistant.components import persistent_notification

from .const import DOMAIN, PLATFORM_SCHEMA, CONF_TEAM, CONF_UPDATE_INTERVAL
from .const import DOMAIN, CONF_TEAM, CONF_UPDATE_INTERVAL
from .API import TeamApp

from .coordinator import MyCoordinator

from homeassistant.config_entries import ConfigEntry

__version__ = "0.1"

Expand Down
11 changes: 0 additions & 11 deletions custom_components/rbfa/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@
CONF_UPDATE_INTERVAL = 'updateinterval'

TZ = 'Europe/Brussels'
START = time( 8, 30)
END = time(22, 30)

PLATFORM_SCHEMA = vol.Schema(
{
vol.Required(CONF_TEAM, default=""): cv.string,
vol.Optional(CONF_RESULT, default='true'): cv.boolean,
vol.Optional(CONF_UPDATE_INTERVAL, default=0): cv.positive_int,
}, extra=vol.ALLOW_EXTRA # Allow extra required due when validating config as sensor (platform key is added to config)
)
# vol.Required(CONF_RESOURCES, default=[]): cv.ensure_list,

VARIABLES = {
'GetTeam': 'teamId',
Expand Down

0 comments on commit 09e6bfe

Please sign in to comment.