diff --git a/bin/release b/bin/release index c36f92d..d661144 100755 --- a/bin/release +++ b/bin/release @@ -97,7 +97,7 @@ if ! pytest; then fi const_path=$(find custom_components/ -name const.py) -version=$(grep "^VERSION =" ${const_path} | sed -E "s/^[^\"]+\"([^\"]*).*$/\\1/") +version=$(grep "^VERSION: Final =" ${const_path} | sed -E "s/^[^\"]+\"([^\"]*).*$/\\1/") if [[ -z $1 ]]; then log.fatal "Please, describe new version number as first argument." @@ -108,7 +108,7 @@ fi new=$(validate_version "${1}") log.info "Patch files to version '${new}'..." -sed -i -E "s/(^VERSION = \")[^\"]*/\\1${new}/" ${const_path} +sed -i -E "s/(^VERSION: Final = \")[^\"]*/\\1${new}/" ${const_path} ./bin/update_manifest if output=$(git status --porcelain) && [[ -n "$output" ]]; then git commit -a --no-verify -m "Bump version to ${new}" diff --git a/custom_components/integration_blueprint/const.py b/custom_components/integration_blueprint/const.py index 25a96a8..33b66e8 100644 --- a/custom_components/integration_blueprint/const.py +++ b/custom_components/integration_blueprint/const.py @@ -1,13 +1,15 @@ """Constants for integration_blueprint.""" # Base component constants -NAME = "Integration blueprint" -DOMAIN = "integration_blueprint" -VERSION = "0.1.0" -ATTRIBUTION = "Data provided by http://jsonplaceholder.typicode.com/" -ISSUE_URL = "https://github.com/Limych/ha-blueprint/issues" +from typing import Final -STARTUP_MESSAGE = f""" +NAME: Final = "Integration blueprint" +DOMAIN: Final = "integration_blueprint" +VERSION: Final = "0.1.0" +ATTRIBUTION: Final = "Data provided by http://jsonplaceholder.typicode.com/" +ISSUE_URL: Final = "https://github.com/Limych/ha-blueprint/issues" + +STARTUP_MESSAGE: Final = f""" ------------------------------------------------------------------- {NAME} Version: {VERSION} @@ -18,24 +20,24 @@ """ # Icons -ICON = "mdi:format-quote-close" +ICON: Final = "mdi:format-quote-close" # Device classes -BINARY_SENSOR_DEVICE_CLASS = "connectivity" +BINARY_SENSOR_DEVICE_CLASS: Final = "connectivity" # Platforms -BINARY_SENSOR = "binary_sensor" -SENSOR = "sensor" -SWITCH = "switch" -PLATFORMS = [BINARY_SENSOR, SENSOR, SWITCH] +BINARY_SENSOR: Final = "binary_sensor" +SENSOR: Final = "sensor" +SWITCH: Final = "switch" +PLATFORMS: Final = [BINARY_SENSOR, SENSOR, SWITCH] # Configuration and options -CONF_ENABLED = "enabled" -CONF_USERNAME = "username" -CONF_PASSWORD = "password" +CONF_ENABLED: Final = "enabled" +CONF_USERNAME: Final = "username" +CONF_PASSWORD: Final = "password" # Defaults -DEFAULT_NAME = DOMAIN +DEFAULT_NAME: Final = DOMAIN # Attributes -ATTR_INTEGRATION = "integration" +ATTR_INTEGRATION: Final = "integration" diff --git a/custom_components/integration_blueprint/manifest.json b/custom_components/integration_blueprint/manifest.json index f90bb7c..81e94a6 100644 --- a/custom_components/integration_blueprint/manifest.json +++ b/custom_components/integration_blueprint/manifest.json @@ -1,9 +1,9 @@ { - "domain": "integration_blueprint", - "name": "Integration blueprint", - "version": "0.1.0", + "domain": "", + "name": "", + "version": "", "documentation": "https://github.com/Limych/ha-blueprint", - "issue_tracker": "https://github.com/Limych/ha-blueprint/issues", + "issue_tracker": "", "dependencies": [], "config_flow": true, "codeowners": [ diff --git a/hacs.json b/hacs.json index aa94fd4..b5c55ea 100644 --- a/hacs.json +++ b/hacs.json @@ -1,5 +1,5 @@ { - "name": "Integration blueprint", + "name": "", "hacs": "1.6.0", "domains": [ "binary_sensor",