Skip to content

Commit

Permalink
Update const.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed Mar 2, 2021
1 parent adcb67c commit a2d4fa4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
25 changes: 13 additions & 12 deletions custom_components/integration_blueprint/const.py
Expand Up @@ -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"

Expand All @@ -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"
9 changes: 5 additions & 4 deletions 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):
Expand Down Expand Up @@ -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,
}
2 changes: 1 addition & 1 deletion 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": [],
Expand Down

0 comments on commit a2d4fa4

Please sign in to comment.