外观
positions API
模块说明
text
Bounded sampled positions and zones; samples are not durable movement events.Zone
python
@dataclass(frozen=True)
class Zone字段(包含继承字段):
Zone.name
python
name: str数据类字段;声明于 positions.Zone。
Zone.dimension
python
dimension: int数据类字段;声明于 positions.Zone。
Zone.minimum
python
minimum: tuple数据类字段;声明于 positions.Zone。
Zone.maximum
python
maximum: tuple数据类字段;声明于 positions.Zone。
Zone.contains
python
def contains(self, dimension, position)ZoneTracker
python
class ZoneTrackerSDK 说明:
text
At most 64 entities × 64 boxes; absence is lost, never a leave reward.
A first observed presence emits enter (also after reset/reload). Changes
between samples can be missed. Consumers must persist business eligibility.ZoneTracker.__init__
python
def __init__(self, zones)ZoneTracker.update
python
def update(self, snapshot)ZoneTracker.reset
python
def reset(self)ZoneTracker.zones
python
self.zones公开实例属性,在 __init__ 中设置。
PositionSampler
python
class PositionSamplerPositionSampler.__init__
python
def __init__(self, ctx)PositionSampler.sample
python
async def sample(self, *, timeout=5, **selection)SDK 说明:
text
One batch query with its durable operation ID; failed reads raise.PositionSampler.watch
python
def watch(self, zones, callback, *, interval=1.0, timeout=5, **selection)SDK 说明:
text
One supervised serial task; no queued polls, coalesced changes per sample.PositionSampler.ctx
python
self.ctx公开实例属性,在 __init__ 中设置。