Remove metadata prefix, it's identical to kind
This commit is contained in:
parent
23a1e2efbd
commit
7b775e3db6
@ -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:
|
||||||
|
@ -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'
|
||||||
|
Loading…
Reference in New Issue
Block a user