Remove metadata prefix, it's identical to kind

This commit is contained in:
Gregoo 2025-01-30 16:35:26 +01:00
parent 344d4fb575
commit fc3c92e9a3
2 changed files with 4 additions and 3 deletions

View File

@ -17,7 +17,6 @@ logger = logging.getLogger(__name__)
# Lego set metadata (customizable list of entries that can be checked) # Lego set metadata (customizable list of entries that can be checked)
class BrickMetadata(BrickRecord): class BrickMetadata(BrickRecord):
kind: str kind: str
prefix: str
# Set state endpoint # Set state endpoint
set_state_endpoint: str set_state_endpoint: str
@ -43,7 +42,10 @@ class BrickMetadata(BrickRecord):
# SQL column name # SQL column name
def as_column(self, /) -> str: def as_column(self, /) -> str:
return '{prefix}_{id}'.format(id=self.fields.id, prefix=self.prefix) return '{kind}_{id}'.format(
id=self.fields.id,
kind=self.kind.lower()
)
# HTML dataset name # HTML dataset name
def as_dataset(self, /) -> str: def as_dataset(self, /) -> str:

View File

@ -7,7 +7,6 @@ from .metadata import BrickMetadata
# Lego set status metadata # Lego set status metadata
class BrickSetStatus(BrickMetadata): class BrickSetStatus(BrickMetadata):
kind: str = 'status' kind: str = 'status'
prefix: str = 'status'
# Set state endpoint # Set state endpoint
set_state_endpoint: str = 'set.update_status' set_state_endpoint: str = 'set.update_status'