Skip to content

class ToioCoreCubeのコメントアウトの仕様説明文が異なる? #14

@henjin0

Description

@henjin0

内容

以下リンクのL111に書いてある説明文ではIf you initialize ToioCoreCube with a CubeInfo or a CubeInterface, you can connect to specified cube by calling the connect() function.とありましたが、#13 のエラー文にあるようにCubeInfoを引数にした場合connect関数が使用できなかったことから、説明文と一致しないと思いIssueを立ち上げました。

If you initialize ToioCoreCube with a CubeInfo or a CubeInterface,

CubeInfoで初期化する仕様がなくなった場合は文章が修正するだけでも良いのかな?と思いつつ、実際にCubeInfoで初期化できることが求められている場合は実装が変える必要があるのかなと思ったので、Issueをあえて分けさせていただきました。。!

実行環境(再掲)

#13 の内容と同じです。

  • RaspberryPi 5 8GB (Bookworm)
  • Python 3.11.2

pip freeze

bleak==2.0.0
dbus-fast==3.1.2
toio.py==1.1.0
typing_extensions==4.15.0

エラー文(再掲)

#13 の内容と同じです。

Traceback (most recent call last):
  File "/home/****/toio_check/toio_official_scan.py", line 17, in <module>
    asyncio.run(scan_and_connect())
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/****/toio_check/toio_official_scan.py", line 9, in scan_and_connect
    await cube.connect()
  File "/home/****/toio_check/toio/lib/python3.11/site-packages/toio/cube/__init__.py", line 229, in connect
    connect_result = await self.interface.connect()
                           ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'CubeInfo' object has no attribute 'connect'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions