Skip to content
This repository was archived by the owner on Nov 14, 2025. It is now read-only.

Commit b703e35

Browse files
committed
Updated Readme
1 parent 3bb0301 commit b703e35

1 file changed

Lines changed: 0 additions & 47 deletions

File tree

README.md

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -239,53 +239,6 @@ n = client.count("ParkingSpot", q='status=="occupied"') # 282
239239
client.close()
240240
```
241241

242-
### Next steps
243-
244-
Create two NGSI-LD agents :
245-
246-
- the first one collects data from parking spots in-ground sensors and cameras then updates the parking spots entities in the broker
247-
- the second one subscribes to parking spots events then updates values in the parking entity, such as the occupancy ratio
248-
249-
Below the code to create the subscription needed by the second agent.
250-
251-
```python
252-
from ngsildclient import SubscriptionBuilder, Client
253-
254-
subscr = SubscriptionBuilder("http://dummy.parkingmanagement.com:8000/parking_spots")
255-
.description("Notify me of parking spot movements")
256-
.select_type("ParkingSpot").watch(["status"])
257-
.build()
258-
259-
with Client(port=8026, port_temporal=8027) as client:
260-
subscr_id = client.subscriptions.create(subscr)
261-
```
262-
263-
The following subscription payload has been generated.
264-
265-
```json
266-
{
267-
"type": "Subscription",
268-
"description": "Notify me of parking spot movements",
269-
"entities": [
270-
{
271-
"type': 'ParkingSpot"
272-
}
273-
],
274-
"watchedAttributes": [
275-
"status"
276-
],
277-
"isActive": true,
278-
"notification": {
279-
"format": "normalized",
280-
"endpoint": {
281-
"uri": "http://dummy.parkingmanagement.com:8000/parking_spots",
282-
"accept": "application/ld+json"
283-
}
284-
},
285-
"@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"
286-
}
287-
```
288-
289242
## Features
290243

291244
### Build NGSI-LD entities

0 commit comments

Comments
 (0)