Skip to content

Commit 6a58594

Browse files
authored
Raspberry Pi hardware detection update (#50)
Better identify Raspberry Pi hardware.
1 parent fc06cc1 commit 6a58594

11 files changed

Lines changed: 1700 additions & 29292 deletions

.eslintrc.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@
7878
"@typescript-eslint/no-unused-vars": [
7979
"error",
8080
{
81-
"vars": "all",
8281
"args": "after-used",
83-
"ignoreRestSiblings": false
82+
"argsIgnorePattern": "^_",
83+
"ignoreRestSiblings": false,
84+
"vars": "all"
8485
}
8586
],
8687
"one-var": "off",

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
## 2.9.0
1+
## 2.9.2
22

3-
* Daylight Saving Time spring-forward/fallback animation.
3+
* Better identifies Raspberry Pi hardware.
4+
5+
## 2.9.1
6+
7+
* Daylight Saving Time spring-forward/fall-back animation.
48
* Fixed some build issues caused by Node.js version 14 not being reliable on Raspberry Pi systems with less than 2 GB RAM — Node.js 12 used on these systems instead.
59
* Removed dependency on node-sass for basic installation, which was often the source of build problems. (If you are trying to modify the code as a developer, node-sass is still needed in the development process, but is now decoupled from deployment.)
610

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ On a display which is narrower than a 16-by-9 aspect ratio, four forecast days c
1616

1717
![app screenshot](https://shetline.com/readme/aw-clock/2.8.0/awc_screenshot.png)
1818

19+
![app dst animation](https://shetline.com/readme/aw-clock/2.8.0/spring-forward-480.gif)
20+
1921
<br/><br/>
2022

2123
### Getting started

build.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ const sudoUser = getSudoUser();
8383
const user = process.env.SUDO_USER || process.env.USER || 'pi';
8484
let uid: number;
8585
const cpuPath = '/proc/cpuinfo';
86+
const cpuPath2 = '/sys/firmware/devicetree/base/model';
8687
const settingsPath = '/etc/default/weatherService';
8788
const rpiSetupStuff = path.join(__dirname, 'raspberry_pi_setup');
8889
const serviceSrc = rpiSetupStuff + '/weatherService';
@@ -100,8 +101,11 @@ if (process.platform === 'linux') {
100101
if (fs.existsSync(cpuPath)) {
101102
const lines = asLines(fs.readFileSync(cpuPath).toString());
102103

104+
if (fs.existsSync(cpuPath2))
105+
lines.push(...asLines(fs.readFileSync(cpuPath2).toString()));
106+
103107
for (const line of lines) {
104-
if (/\bModel\s*:\s*Raspberry Pi\b/i.test(line)) {
108+
if (/\b(Raspberry Pi|BCM\d+)\b/i.test(line)) {
105109
isRaspberryPi = treatAsRaspberryPi = true;
106110
autostartDst += '-pi';
107111
chromium += '-browser';

0 commit comments

Comments
 (0)