diff --git a/external_samples/color_range_sensor.py b/external_samples/color_range_sensor.py index 775298f3..9b422bda 100644 --- a/external_samples/color_range_sensor.py +++ b/external_samples/color_range_sensor.py @@ -17,7 +17,7 @@ # @author alan@porpoiseful.com (Alan Smith) from component import Component, PortType, InvalidPortException -from collections.abc import Protocol +from typing import Protocol class DistanceCallable(Protocol): def __call__(self, distance : float) -> None: @@ -78,4 +78,4 @@ def register_when_saturation_in_range(self, min_saturation : int, max_saturation : int, callback : ColorCallable) -> None: '''Event when saturation is in range''' - self.saturation_in_range_callback = callback \ No newline at end of file + self.saturation_in_range_callback = callback diff --git a/external_samples/component.py b/external_samples/component.py index 86d582b9..482c565a 100644 --- a/external_samples/component.py +++ b/external_samples/component.py @@ -18,7 +18,7 @@ from abc import ABC, abstractmethod from enum import Enum -from collections.abc import Protocol +from typing import Protocol class EmptyCallable(Protocol): def __call__(self) -> None: @@ -83,4 +83,4 @@ def get_connection_port_type(self) -> list[PortType]: # to talk to hardware and then call callbacks @abstractmethod def periodic(self) -> None: - pass \ No newline at end of file + pass diff --git a/external_samples/sparkfun_led_stick.py b/external_samples/sparkfun_led_stick.py index b44d0237..7d890f4e 100644 --- a/external_samples/sparkfun_led_stick.py +++ b/external_samples/sparkfun_led_stick.py @@ -1,5 +1,20 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +__author__ = "lizlooney@google.com (Liz Looney)" + from component import Component, PortType, InvalidPortException -from enum import Enum import wpilib class SparkFunLEDStick(Component):