crismc / rpi_i2c_oled Goto Github PK
View Code? Open in Web Editor NEWPython library to enable 128x32 pixel OLED for Raspberry Pi (both 32 and 64bit).
License: MIT License
Python library to enable 128x32 pixel OLED for Raspberry Pi (both 32 and 64bit).
License: MIT License
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[13:58:51] INFO: Starting I2C OLED App...
/dev/i2c-1
[13:58:51] INFO: /dev/i2c-1 enabled
[13:58:51] INFO: I2C access enabled. Proceeding!
[13:58:51] INFO: Display Info to OLED
[13:58:51] INFO: Running 'python3 display.py -c /data/options.json'
Traceback (most recent call last):
File "/I2C_OLED/display.py", line 5, in
from bin.Config import Config
File "/I2C_OLED/bin/Config.py", line 5, in
from bin.Screens import *
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/I2C_OLED/bin/Screens.py", line 53, in
class BaseScreen:
File "/I2C_OLED/bin/Screens.py", line 58, in BaseScreen
def init(self, duration, display = Display(), utils = Utils(), config = None):
^^^^^^^^^
File "/I2C_OLED/bin/Screens.py", line 17, in init
self.clear()
File "/I2C_OLED/bin/Screens.py", line 27, in clear
self.display.begin()
File "/I2C_OLED/bin/SSD1306.py", line 97, in begin
self._initialize()
File "/I2C_OLED/bin/SSD1306.py", line 154, in _initialize
self.command(SSD1306_DISPLAYOFF) # 0xAE
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/I2C_OLED/bin/SSD1306.py", line 89, in command
self._bus.write_byte_data(self._address, control, value)
OSError: [Errno 121] Remote I/O error
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
No response
No response
YAML state
- Browser: Firefox
- HA Version:11.03
- I2C_OLED: JMDO 96 c
No response
Code quality improvements.
Run ruff formatter on all *.py files. Also should set the target Python version for the code repository in pyproject.toml
(e.g. 3.10?) so when various code checking and formatting tools run they know what syntax is valid.
Ruff is starting to replace usage of the long-standing black8 and brunette formatters.
Recommend adding .pre-commit-config.yaml
in project root with the following once ruff
has been run, so those that use pre-commit will ensure that new code automatically is formatted to the project's standards as well.
---
# pre-commit autoupdate
fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
# isort - sort import statements
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
files: \.(py)$
args: [--settings-path=pyproject.toml] # ["--profile", "black" ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
hooks:
- id: ruff
args: [ --fix ] # run linter
- id: ruff-format # run formatter
#### OPTIONAL: for keeping syntax more current
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py310-plus] # keep 2 versions behind current
- repo: https://github.com/dosisod/refurb
rev: v2.0.0
hooks:
- id: refurb
Yes, it is very hard to read text in many circumstances.
Additional configurability around how text and icons are displayed
No response
No response
CPU load data does not populate. It's showing 0.000.00%
CPU load is expected to show the current CPU load, which isnt 0.000.00%
YAML state
- Browser:
- HA Version:
- I2C_OLED: 1.0.3
No response
No
Will be nice to navigate to a menu and be able to perform some task like reboot, docker container restart (homeassistant restart) and other custom commands via config file.
No response
No response
No
I know that this brings in a big dependency, but maybe use a library like Luma.oled to support more displays? It also handles the hardware i2c, supports LCD's etc and effects like panning/zooming etc. Luma.core.
There is also an SPI driver in the core library.
I've forked the repository and successfully implement another display driver in a very trivial manner.
Example
I've tested it by forking your repository Home Assistant Addons and installing on multiple RPI's with HaOS. My displays are 128x64 and render only half the height obviously, but I've noticed there is already a pull request for supporting that.
how hard would it be to add support for SSD1306_128_64? I was debating on branching this and give it a go.
Be able to use a 128x64 screen
No response
Here is the screen I currently using and would like to add support for.
https://www.amazon.com/gp/product/B07VDXYDVY
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.