|
@@ -29,6 +29,8 @@ class InfoCode(str, Enum):
|
|
supply_static_press = 'SupplyStaticPress'
|
|
supply_static_press = 'SupplyStaticPress'
|
|
supply_static_press_set = 'SupplyStaticPressSet'
|
|
supply_static_press_set = 'SupplyStaticPressSet'
|
|
running_status = 'RunStatus'
|
|
running_status = 'RunStatus'
|
|
|
|
+ cloud_status = 'InCloudStatus'
|
|
|
|
+ equip_switch_set = 'EquipSwitchSet'
|
|
|
|
|
|
|
|
|
|
class DataPlatformService(Service):
|
|
class DataPlatformService(Service):
|
|
@@ -232,6 +234,9 @@ class DataPlatformService(Service):
|
|
async def get_realtime_running_status(self, equipment_id: str) -> float:
|
|
async def get_realtime_running_status(self, equipment_id: str) -> float:
|
|
return await self.get_realtime_data(InfoCode.running_status, equipment_id)
|
|
return await self.get_realtime_data(InfoCode.running_status, equipment_id)
|
|
|
|
|
|
|
|
+ async def get_cloud_status(self, equipment_id: str) -> float:
|
|
|
|
+ return await self.get_realtime_data(InfoCode.cloud_status, equipment_id)
|
|
|
|
+
|
|
async def set_code_value(self, object_id: str, code: InfoCode, value: float):
|
|
async def set_code_value(self, object_id: str, code: InfoCode, value: float):
|
|
url = self._base_url.join('data-platform-3/parameter/setting')
|
|
url = self._base_url.join('data-platform-3/parameter/setting')
|
|
params = self._common_parameters()
|
|
params = self._common_parameters()
|
|
@@ -242,3 +247,17 @@ class DataPlatformService(Service):
|
|
}
|
|
}
|
|
|
|
|
|
await self._post(url, params, payload)
|
|
await self._post(url, params, payload)
|
|
|
|
+
|
|
|
|
+ async def get_items_by_category(self, code) -> List:
|
|
|
|
+ url = self._base_url.join('data-platform-3/object/subset_query')
|
|
|
|
+ params = self._common_parameters()
|
|
|
|
+ payload = {
|
|
|
|
+ 'criteria': {
|
|
|
|
+ 'type': [code]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ raw_info = await self._post(url, params, payload)
|
|
|
|
+ items_id_list = [item['id'] for item in raw_info['Content']]
|
|
|
|
+
|
|
|
|
+ return items_id_list
|