While the new TargetCategory class supports subtypes, only reading them is currently available; setting subtypes will be introduced in a future release.
-
TargetComponentswas reworked. It now is a type alias forTargetIds | TargetCategories: -
TargetIdscan be used to specify one or more specific target IDs: -
TargetIds(1, 2, 3)or -
TargetIds(ComponentIds(1), ComponentIds(2), ComponentIds(3)) -
TargetCategoriescan be used to specify one or more target categories: -
TargetCategories(ComponentCategory.BATTERY, ComponentCategory.INVERTER) -
DispatchApiClient.stream()now returns a streamer instead of a receiver. This allows you to use the newnew_receivermethod to create a receiver with more options, such asmax_size,warn_on_overflowandinclude_events.client = DispatchApiClient( key="key", server_url="grpc://dispatch.url.goes.here.example.com" ) receiver = client.stream(microgrid_id=1).new_receiver() async for message in receiver: print(message.event, message.dispatch)
- With the new
TargetCategoryclass (providing.categoryand.type) we can now specify subtypes of the categories: ComponentCategory.BATTERYusesBatteryTypewith possible values:LI_ION,NA_IONComponentCategory.INVERTERusesInverterTypewith possible values:BATTERY,SOLAR,HYBRIDComponentCategory.EV_CHARGERusesEvChargerType: with possible valuesAC,DC,HYBRID- A few examples on how to use the new
TargetCategory:TargetCategory(BatteryType.LI_ION)categoryisComponentCategory.BATTERYtypeisBatteryType.LI_ION
TargetCategory(ComponentCategory.BATTERY)categoryisComponentCategory.BATTERYtypeisNone
TargetCategories(InverterType.SOLAR)categoryisComponentCategory.INVERTERtypeisInverterType.SOLAR