fix(esp32): use JS template literals (backticks) for stub interpolation
This commit is contained in:
parent
8a89322808
commit
9e9a3e7800
|
|
@ -1330,7 +1330,7 @@ export const useSimulatorStore = create<SimulatorState>((set, get) => {
|
||||||
'sys.modules["network"] = _StubNetwork()',
|
'sys.modules["network"] = _StubNetwork()',
|
||||||
'',
|
'',
|
||||||
'# ntptime: pre-load RTC with host UTC so localtime() works.',
|
'# ntptime: pre-load RTC with host UTC so localtime() works.',
|
||||||
f'_VLX_BOOT_UTC = ({now.getUTCFullYear()}, {now.getUTCMonth() + 1}, {now.getUTCDate()}, {now.getUTCDay() || 7}, {now.getUTCHours()}, {now.getUTCMinutes()}, {now.getUTCSeconds()}, 0)',
|
`_VLX_BOOT_UTC = (${now.getUTCFullYear()}, ${now.getUTCMonth() + 1}, ${now.getUTCDate()}, ${now.getUTCDay() || 7}, ${now.getUTCHours()}, ${now.getUTCMinutes()}, ${now.getUTCSeconds()}, 0)`,
|
||||||
'class _StubNTP:',
|
'class _StubNTP:',
|
||||||
' host = "pool.ntp.org"',
|
' host = "pool.ntp.org"',
|
||||||
' timeout = 1',
|
' timeout = 1',
|
||||||
|
|
@ -1345,7 +1345,7 @@ export const useSimulatorStore = create<SimulatorState>((set, get) => {
|
||||||
'',
|
'',
|
||||||
'# urequests: fake responses so examples that call HTTP APIs',
|
'# urequests: fake responses so examples that call HTTP APIs',
|
||||||
'# show real-looking data on the OLED instead of "API Error".',
|
'# show real-looking data on the OLED instead of "API Error".',
|
||||||
f'_VLX_WEATHER = {{"main": {{"temp": 22.5, "humidity": 58, "pressure": 1013}}, "weather": [{{"main": "Clouds", "description": "partly cloudy"}}], "name": "{fakeWeatherCity}", "wind": {{"speed": 3.4}}}}',
|
`_VLX_WEATHER = {"main": {"temp": 22.5, "humidity": 58, "pressure": 1013}, "weather": [{"main": "Clouds", "description": "partly cloudy"}], "name": "${fakeWeatherCity}", "wind": {"speed": 3.4}}`,
|
||||||
'class _StubResponse:',
|
'class _StubResponse:',
|
||||||
' def __init__(self, payload):',
|
' def __init__(self, payload):',
|
||||||
' self._payload = payload',
|
' self._payload = payload',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue