hass-core/homeassistant/components/seventeentrack/const.py
Shai Ungar b6609fa77c
Deprecate the dynamic package sensors in seventeentrack (#116102)
* Add deprecation comments for the dynamic package sensors

* Add deprecation comments for the dynamic package sensors

* Add deprecation comments for the dynamic package sensors

add more information when retrieving packages from service call

* Add deprecation comments for the dynamic package sensors

update deprecation comment

* 1. 17Track repair flow
2. update deprecation comment

* 1. remove description_placeholders
2. 2024.8 deprecated

* Update homeassistant/components/seventeentrack/repairs.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* 1. extract deprecated to constant
2. fix types
3. check for issue_id
4. add listener only when not deprecated
5. update which service to call

* Update homeassistant/components/seventeentrack/strings.json

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/repairs.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* 1. move deprecate_sensor_issue to where needed
2. add entry_id to issue_id
3. use constant where needed

* update breaks in ha version

* Update homeassistant/components/seventeentrack/strings.json

* Remove obsolete tests

* Fix

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-07-07 16:55:38 +02:00

49 lines
1.3 KiB
Python

"""Constants for the 17track.net component."""
from datetime import timedelta
import logging
LOGGER = logging.getLogger(__package__)
ATTR_DESTINATION_COUNTRY = "destination_country"
ATTR_INFO_TEXT = "info_text"
ATTR_TIMESTAMP = "timestamp"
ATTR_ORIGIN_COUNTRY = "origin_country"
ATTR_PACKAGES = "packages"
ATTR_PACKAGE_TYPE = "package_type"
ATTR_STATUS = "status"
ATTR_TRACKING_INFO_LANGUAGE = "tracking_info_language"
ATTR_TRACKING_NUMBER = "tracking_number"
CONF_SHOW_ARCHIVED = "show_archived"
CONF_SHOW_DELIVERED = "show_delivered"
DEFAULT_SHOW_ARCHIVED = False
DEFAULT_SHOW_DELIVERED = False
DOMAIN = "seventeentrack"
DATA_PACKAGES = "package_data"
DATA_SUMMARY = "summary_data"
ATTRIBUTION = "Data provided by 17track.net"
DEFAULT_SCAN_INTERVAL = timedelta(minutes=10)
UNIQUE_ID_TEMPLATE = "package_{0}_{1}"
ENTITY_ID_TEMPLATE = "sensor.seventeentrack_package_{0}"
NOTIFICATION_DELIVERED_ID = "package_delivered_{0}"
NOTIFICATION_DELIVERED_TITLE = "Package {0} delivered"
NOTIFICATION_DELIVERED_MESSAGE = (
"Package Delivered: {0}<br />Visit 17.track for more information: "
"https://t.17track.net/track#nums={1}"
)
VALUE_DELIVERED = "Delivered"
SERVICE_GET_PACKAGES = "get_packages"
ATTR_PACKAGE_STATE = "package_state"
ATTR_CONFIG_ENTRY_ID = "config_entry_id"
DEPRECATED_KEY = "deprecated"