Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning diagnostic for V2 API use #35

Merged
merged 10 commits into from
May 23, 2024

Conversation

microbit-matt-hillsdon
Copy link

@microbit-matt-hillsdon microbit-matt-hillsdon commented May 22, 2024

Alternative to #33

I've tried to pull the logic into checker.ts which feels more suitable for a high-level check.

Test data (I think the key parts of this are now in the automated tests):

# Imports go at the top
from microbit import *
from microbit import run_every
import log
import neopixel
from power import deep_sleep
import power

power.off()

deep_sleep(10)

log.add({
  'temperature': temperature(),
  'sound': microphone.sound_level(),
  'light': display.read_light_level()
})

pin_logo.get_mode()
pin_speaker
Sound.GIGGLE

audio.SoundEffect()

pin0.CAPACITIVE

np = neopixel.NeoPixel(pin12, 8)
np.fill((0, 0, 233))
np.write()

We plan to filter these out on the client based on connected device
version.
Copy link

@microbit-robert microbit-robert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Works well. One comment to remove an outdated comment.

@microbit-matt-hillsdon microbit-matt-hillsdon merged commit 88fe2c9 into microbit May 23, 2024
@microbit-matt-hillsdon microbit-matt-hillsdon deleted the version-warning-2 branch May 23, 2024 13:11
microbit-matt-hillsdon pushed a commit to microbit-foundation/python-editor-v3 that referenced this pull request May 23, 2024
Updates Pyright to a version with the changes from microbit-foundation/pyright#35 and conditionally hides the new messages depending on the connected device.

A new setting can hide the messages. The setting can be flipped from a CodeMirror diagnostic action.

See https://microbit-global.monday.com/boards/1125389526/views/244984/pulses/1434825789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants