GithubHelp home page GithubHelp logo

jamffm / cbpi4-lcdisplay Goto Github PK

View Code? Open in Web Editor NEW
2.0 5.0 2.0 316 KB

This is the LCDisplay for CraftBeerPi4

License: GNU General Public License v3.0

Python 96.92% HTML 1.33% CSS 1.76%
cbpi4 craftbeerpi lcd lcd20x4 beer brewing-beer brewing-software brewing-controller

cbpi4-lcdisplay's People

Contributors

jamffm avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cbpi4-lcdisplay's Issues

Kettle Heater Status

Hi, I was browsing your code and found you want to get the status of the kettle heater element.

Assuming you do have a kettle_ID:

kettle = self.cbpi.kettle.find_by_id(kettle_ID)
heater = self.cbpi.actor.find_by_id(kettle.heater)
kettle_heater_state = heater.instance.state

Regards,
Alex

cbpi version for Stanby screen

CBPi Version can be retrieved via this object which is independent of any path.

    async def show_standby(self):
        ip = await self.set_ip()
        cbpi_version = self.cbpi.version
        ............

Problem with get_ip if wlan is not connected

I experienced this already with the cbpi3 version when I connected the pi to ethernet and disabled the wlan connection.

Although the get_ip function has a try, the issue appears because there is no except.
By adding the except, the issue is solved. WLAN returns with 'Not connected' and the scrit moves on the eth0

    async def get_ip(self, interface):
        ip_addr = 'Not connected'
        so = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        try:
            ip_addr = socket.inet_ntoa(
                fcntl.ioctl(so.fileno(), 0x8915, struct.pack('256s', bytes(interface.encode())[:15]))[20:24])
        except:
            return ip_addr        
        finally:
            return ip_addr

smbus2 required -> could be added to setup.py

smbus2 is required for the plugin which is not installed per default. This could be added to the setup.py and would be installed automatically with installation of the plugin.
...............
packages=['LCDisplay'],
install_requires=[
'cbpi>=4.0.0.33',
'smbus2',
],
..................

Plugin loads but doesn't display anything

I've recently installed CBPI4 after using CBPI3 for about a year without any problems. The LCD worked fine with CBPI3.

The plugin loads fine, no errors and the i2c address is recognised but nothing appears on the display. When the CBPI server is stopped I get the following error:

2022-06-14:13:22:00,928 ERROR [base_events.py:1738] Task exception was never retrieved
future: <Task finished name='Task-5' coro=<LCDisplay.run() done, defined at /usr/local/lib/python3.9/dist-packages/cbpi4-LCDisplay/init.py:127> exception=TypeError("'NoneType' object is not subscriptable")>
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/cbpi4-LCDisplay/init.py", line 167, in run
sensor_for_sensor_mode = await self.set_lcd_sensortype_for_sensor_mode()
File "/usr/local/lib/python3.9/dist-packages/cbpi4-LCDisplay/init.py", line 588, in set_lcd_sensortype_for_sensor_mode
sensor_type = (sensor_values["sensor_type"])
TypeError: 'NoneType' object is not subscriptable

I've done a number of clean installs of CBPI4 and re-installs of the plugin but the error persists. Any ideas?

Many thanks in advance.

Nick

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.