diff --git a/custom_components/integration_blueprint/const.py b/custom_components/integration_blueprint/const.py index c3d5f6b..0d82802 100644 --- a/custom_components/integration_blueprint/const.py +++ b/custom_components/integration_blueprint/const.py @@ -3,11 +3,20 @@ # Base component constants NAME = "Integration blueprint" DOMAIN = "integration_blueprint" -DOMAIN_DATA = f"{DOMAIN}_data" -VERSION = "0.0.0+dev" +VERSION = "0.0.0.dev0" ATTRIBUTION = "Data provided by http://jsonplaceholder.typicode.com/" ISSUE_URL = "https://github.com/Limych/ha-blueprint/issues" +STARTUP_MESSAGE = f""" +------------------------------------------------------------------- +{NAME} +Version: {VERSION} +This is a custom integration! +If you have ANY issues with this you need to open an issue here: +{ISSUE_URL} +------------------------------------------------------------------- +""" + # Icons ICON = "mdi:format-quote-close" @@ -28,13 +37,5 @@ # Defaults DEFAULT_NAME = DOMAIN - -STARTUP_MESSAGE = f""" -------------------------------------------------------------------- -{NAME} -Version: {VERSION} -This is a custom integration! -If you have ANY issues with this you need to open an issue here: -{ISSUE_URL} -------------------------------------------------------------------- -""" +# Attributes +ATTR_INTEGRATION = "integration" diff --git a/custom_components/integration_blueprint/entity.py b/custom_components/integration_blueprint/entity.py index c54ad8b..21a3f97 100644 --- a/custom_components/integration_blueprint/entity.py +++ b/custom_components/integration_blueprint/entity.py @@ -1,7 +1,8 @@ """BlueprintEntity class.""" +from homeassistant.const import ATTR_ATTRIBUTION, ATTR_ID from homeassistant.helpers.update_coordinator import CoordinatorEntity -from .const import ATTRIBUTION, DOMAIN, NAME, VERSION +from .const import ATTR_INTEGRATION, ATTRIBUTION, DOMAIN, NAME, VERSION class IntegrationBlueprintEntity(CoordinatorEntity): @@ -31,7 +32,7 @@ def device_info(self): def device_state_attributes(self): """Return the state attributes.""" return { - "attribution": ATTRIBUTION, - "id": str(self.coordinator.data.get("id")), - "integration": DOMAIN, + ATTR_ATTRIBUTION: ATTRIBUTION, + ATTR_ID: str(self.coordinator.data.get("id")), + ATTR_INTEGRATION: DOMAIN, } diff --git a/custom_components/integration_blueprint/manifest.json b/custom_components/integration_blueprint/manifest.json index 3f60f4a..2fbc284 100644 --- a/custom_components/integration_blueprint/manifest.json +++ b/custom_components/integration_blueprint/manifest.json @@ -1,7 +1,7 @@ { "domain": "integration_blueprint", "name": "Integration blueprint", - "version": "0.0.0+dev", + "version": "0.0.0.dev0", "documentation": "https://github.com/Limych/ha-blueprint", "issue_tracker": "https://github.com/Limych/ha-blueprint/issues", "dependencies": [],