Skip to content

Commit

Permalink
fix: fix cinemark
Browse files Browse the repository at this point in the history
  • Loading branch information
hudsonbrendon committed Sep 12, 2022
1 parent c71db88 commit 49bc211
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ sensor:
platform: ingresso
city_id: 48
city_name: Natal
partnership: moviecom
partnership: cinemark
4 changes: 1 addition & 3 deletions custom_components/ingresso/const.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from datetime import timedelta

BASE_URL = "https://api-content.ingresso.com/v0/templates/nowplaying/{}?partnership={}"
ICON = "mdi:ticket"

CONF_CITY_ID = "city_id"
CONF_CITY_NAME = "city_name"
CONF_PARTNERSHIP = "partnership"
SCAN_INTERVAL = timedelta(minutes=120)
DEFAULT_POSTER = "https://www.youtube.com/user/ingressocom"
4 changes: 2 additions & 2 deletions custom_components/ingresso/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
CONF_CITY_ID,
CONF_CITY_NAME,
CONF_PARTNERSHIP,
DEFAULT_POSTER,
ICON,
SCAN_INTERVAL,
)

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
Expand Down Expand Up @@ -110,7 +110,7 @@ def update(self):
[
dict(
title=movie.get("title", "Não informado"),
poster=movie["images"][0]["url"],
poster=movie["images"][0]["url"] if movie["images"] else DEFAULT_POSTER,
synopsis=movie.get("synopsis", "Não informado"),
director=movie.get("director", "Não informado"),
cast=movie.get("cast", "Não informado"),
Expand Down

0 comments on commit 49bc211

Please sign in to comment.