You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Current ngsild post entity will ignore all unset and default varaiables when posting the entity
To Reproduce
frompydanticimportBaseModelfrompydantic.fieldsimportField, FieldInfofromfilip.modelsimportFiwareLDHeaderfromfilip.models.ngsi_ld.contextimportContextLDEntityKeyValuesfromfilip.clients.ngsi_ld.cbimportContextBrokerLDClientclassOutsideAirTemperatureSensor(
BaseModel):
""" https://brickschema.org/schema/Brick#Outside_Air_Temperature_Sensor """temperature: float=Field(
default=20.0,
description="brick:Quantity, measure temperature in degree Celsius"
)
classOutsideAirTemperatureSensorFIWARE(OutsideAirTemperatureSensor, ContextLDEntityKeyValues):
type: str=FieldInfo.merge_field_infos(
# Field info of the general FIWARE data model in FiLiPContextLDEntityKeyValues.model_fields["type"],
default="OutsideAirTemperatureSensor"
)
CB_URL="http://localhost:1027"NGSILD_TENANT='filip'# NGSI Tennant (equivalant to FIWARE service in NGSI v2)SERVICE_PATH='/'# FIWARE-Servicepathfiware_header=FiwareLDHeader(ngsild_tenant=NGSILD_TENANT)
cb_client=ContextBrokerLDClient(url=CB_URL, fiware_header=fiware_header)
t_sen=OutsideAirTemperatureSensorFIWARE(id="OutsideAirTemperatureSensor:01")
cb_client.post_entity(entity=t_sen, update=True)
Expected behavior
The entity above can be created
The text was updated successfully, but these errors were encountered:
Describe the bug
Current ngsild post entity will ignore all unset and default varaiables when posting the entity
To Reproduce
Expected behavior
The entity above can be created
The text was updated successfully, but these errors were encountered: