diff --git a/pyproject.toml b/pyproject.toml index a45aada..3ffaf51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "oshconnect" -version = "0.3.0a5" +version = "0.3.0a5.post1" description = "Library for interfacing with OSH, helping guide visualization efforts, and providing a place to store configurations." readme = "README.md" authors = [ diff --git a/src/oshconnect/resource_datamodels.py b/src/oshconnect/resource_datamodels.py index 766bcc9..8262b9a 100644 --- a/src/oshconnect/resource_datamodels.py +++ b/src/oshconnect/resource_datamodels.py @@ -8,14 +8,13 @@ from typing import List -from timemanagement import TimeInstant -from .geometry import Geometry -from .api_utils import Link from pydantic import BaseModel, ConfigDict, Field, SerializeAsAny, model_validator from shapely import Point +from .api_utils import Link +from .geometry import Geometry from .schema_datamodels import DatastreamRecordSchema, CommandSchema -from .timemanagement import TimePeriod +from .timemanagement import TimeInstant, TimePeriod class BoundingBox(BaseModel): diff --git a/src/oshconnect/streamableresource.py b/src/oshconnect/streamableresource.py index 0977cfe..c4ba112 100644 --- a/src/oshconnect/streamableresource.py +++ b/src/oshconnect/streamableresource.py @@ -24,6 +24,8 @@ from uuid import UUID, uuid4 from collections import deque +from pydantic.v1.utils import to_lower_camel + from .csapi4py.constants import ContentTypes from .schema_datamodels import JSONCommandSchema from .csapi4py.mqtt import MQTTCommClient @@ -193,7 +195,10 @@ def discover_systems(self): for system_json in system_objs: print(system_json) system = SystemResource.model_validate(system_json) - sys_obj = System.from_system_resource(system, self) + sys_obj = System(label=system.properties['name'], + name=to_lower_camel(system.properties['name'].replace(" ", "_")), + urn=system.properties['uid'], parent_node=self) + self._systems.append(sys_obj) new_systems.append(sys_obj) return new_systems diff --git a/uv.lock b/uv.lock index 1afb18e..7415994 100644 --- a/uv.lock +++ b/uv.lock @@ -436,7 +436,7 @@ wheels = [ [[package]] name = "oshconnect" -version = "0.3.0a5" +version = "0.3.0a5.post1" source = { virtual = "." } dependencies = [ { name = "aiohttp" },