File tree Expand file tree Collapse file tree 3 files changed +3
-15
lines changed Expand file tree Collapse file tree 3 files changed +3
-15
lines changed Original file line number Diff line number Diff line change 11611161 "from viam.app.viam_client import ViamClient\n",
11621162 "\n",
11631163 "async def connect() -> ViamClient:\n",
1164- " dial_options = DialOptions(\n",
1165- " auth_entity='<ADDRESS>', # The URL of your robot.\n",
1166- " credentials=Credentials(\n",
1167- " type='robot-location-secret',\n",
1168- " payload='<SECRET>'\n",
1169- " )\n",
1170- " )\n",
1164+ " dial_options = DialOptions.with_api_key(api_key='<API_KEY>', api_key_id='<API_KEY_ID>')\n",
11711165 " return await ViamClient.create_from_dial_options(dial_options)"
11721166 ]
11731167 },
Original file line number Diff line number Diff line change 33from src .gizmo import Gizmo
44from src .summation import SummationService
55
6- from viam import logging
76from viam .robot .client import RobotClient
8- from viam .rpc .dial import Credentials , DialOptions
97from viam .components .base import Base
108
119
1210async def connect ():
13- creds = Credentials (type = "<your authentication type here>" , payload = "<your authentication payload here>" )
14- opts = RobotClient .Options (refresh_interval = 0 , dial_options = DialOptions (credentials = creds ), log_level = logging .DEBUG )
11+ opts = RobotClient .Options .with_api_key (api_key = "<your api key here>" , api_key_id = "<your api key ID here>" )
1512 return await RobotClient .at_address ("<your robot uri here>" , opts )
1613
1714
Original file line number Diff line number Diff line change 11import asyncio
22
3- from viam import logging
43from viam .robot .client import RobotClient
5- from viam .rpc .dial import Credentials , DialOptions
64from viam .components .sensor import Sensor
75
86
97async def connect ():
10- creds = Credentials (type = "<your authentication type here>" , payload = "<your authentication payload here>" )
11- opts = RobotClient .Options (refresh_interval = 0 , dial_options = DialOptions (credentials = creds ), log_level = logging .DEBUG )
8+ opts = RobotClient .Options .with_api_key (api_key = "<your api key here>" , api_key_id = "<your api key ID here>" )
129 return await RobotClient .at_address ("<your robot uri here>" , opts )
1310
1411
You can’t perform that action at this time.
0 commit comments