Skip to content

Commit

Permalink
Ajusta hora e data atual
Browse files Browse the repository at this point in the history
  • Loading branch information
Hudson Brendon committed Jun 18, 2021
1 parent b450472 commit 56a682e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion custom_components/clarotv/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "clarotv",
"name": "Claro TV",
"version": "0.2.4",
"version": "0.3.4",
"documentation": "https://github.com/hudsonbrendon/sensor.claro.com.br",
"dependencies": [],
"codeowners": ["@hudsonbrendon"],
Expand Down
5 changes: 2 additions & 3 deletions custom_components/clarotv/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@ def __init__(self, channel_id, channel_name, channel_logo, name, session):
async def async_update(self):
"""Update sensor."""
_LOGGER.debug("%s - Running update", self._name)
first_date = datetime.now(pytz.timezone("America/Sao_Paulo"))
second_date = first_date + relativedelta(months=1)
try:

first_date = datetime.now(pytz.timezone("America/Sao_Paulo"))
second_date = first_date + relativedelta(months=1)
url = BASE_URL.format(
first_date.strftime("%Y-%m-%dT%H:%M:%SZ"),
second_date.strftime("%Y-%m-%dT%H:%M:%SZ"),
Expand Down

0 comments on commit 56a682e

Please sign in to comment.