示例#1
0
    def __init__(
        self,
        *,
        url=None,
        headers=None,
        json_path=None,
        regexp_path=None,
        default_bg=0x000000,
        status_neopixel=None,
        json_transform=None,
        esp=None,
        external_spi=None,
        bit_depth=2,
        alt_addr_pins=None,
        color_order="RGB",
        debug=False,
        width=64,
        height=32,
        serpentine=True,
        tile_rows=1,
        rotation=0,
    ):

        graphics = Graphics(
            default_bg=default_bg,
            bit_depth=bit_depth,
            width=width,
            height=height,
            alt_addr_pins=alt_addr_pins,
            color_order=color_order,
            serpentine=serpentine,
            tile_rows=tile_rows,
            rotation=rotation,
            debug=debug,
        )

        network = Network(
            status_neopixel=status_neopixel,
            esp=esp,
            external_spi=external_spi,
            extract_values=False,
            debug=debug,
        )

        super().__init__(
            network,
            graphics,
            url=url,
            headers=headers,
            json_path=json_path,
            regexp_path=regexp_path,
            json_transform=json_transform,
            debug=debug,
        )

        self._scrolling_index = None

        gc.collect()
示例#2
0
    def __init__(
        self,
        *,
        url=None,
        headers=None,
        json_path=None,
        regexp_path=None,
        default_bg=0x000000,
        status_neopixel=None,
        json_transform=None,
        esp=None,
        external_spi=None,
        bit_depth=2,
        alt_addr_pins=None,
        color_order="RGB",
        debug=False,
        width=64,
        height=32,
    ):

        self._debug = debug
        self.graphics = Graphics(
            default_bg=default_bg,
            bit_depth=bit_depth,
            width=width,
            height=height,
            alt_addr_pins=alt_addr_pins,
            color_order=color_order,
            debug=debug,
        )
        self.display = self.graphics.display

        self.network = Network(
            status_neopixel=status_neopixel,
            esp=esp,
            external_spi=external_spi,
            extract_values=False,
            debug=debug,
        )

        self._url = None
        self.url = url
        self._headers = headers
        self._json_path = None
        self.json_path = json_path

        self._regexp_path = regexp_path

        self.splash = self.graphics.splash

        # Add any JSON translators
        if json_transform:
            self.network.add_json_transform(json_transform)

        self._text = []
        self._text_color = []
        self._text_position = []
        self._text_wrap = []
        self._text_maxlen = []
        self._text_transform = []
        self._text_scrolling = []
        self._text_scale = []
        self._scrolling_index = None
        self._text_font = []
        self._text_line_spacing = []

        gc.collect()