Skip to content

Commit

Permalink
Merge branch 'beta-development' of https://github.com/jekhokie/raspbe…
Browse files Browse the repository at this point in the history
…rry-noaa-v2 into beta-development

* 'beta-development' of https://github.com/jekhokie/raspberry-noaa-v2:
  Beta development - Update dependencies/yml - added become: yes for .config ownership (jekhokie#1057)
  Fix deprecation warning in heatmap.py (jekhokie#1059)
  Allow odd timezones in sun.py (jekhokie#1056)
  • Loading branch information
jp112sdl committed Sep 5, 2024
2 parents 2371aef + 8b94629 commit 0f8e13d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions ansible/roles/common/tasks/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
# This problem does not occur on OS Full installations

- name: .config directory ownership
become: yes
file:
path: /home/{{ target_user }}/.config
state: directory
Expand Down
8 changes: 4 additions & 4 deletions docs/facebook_push.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ and created a Facebook page, you must then set the application permissions to be

* **API Key**: `FACEBOOK_ACCESS_TOKEN=""`

The Key you are to enter is your Page Token - [See How to get a Facebook page access token in 2024](https://www.sociablekit.com/how-to-get-a-facebook-page-access-token/)

## Testing (Optional)

If you want to run a manual test to ensure the Facebook configurations are acceptable, you can run a quick test
from the command line and pass an actual image file (or many) to the command like so:

```bash
./scripts/push_processors/push_facebook.sh "test annotation" \
"/srv/images/NOAA-18-20210212-091356-MCIR.jpg" \
"/srv/images/NOAA-19-20210311-060645-ZA.jpg" \
"/srv/images/NOAA-19-20210311-060645-spectrogram.png"
${HOME}/raspberry-noaa-v2/scripts/push_processors/push_facebook.py "test annotation" \
"/srv/images/NOAA-15-20240826-143009-HVCT.jpg /srv/images/NOAA-15-20240826-143009-sea.jpg /srv/images/NOAA-15-20240826-143009-polar-direction.png"
```

If all goes well and the image paths passed are files that actually exist, you should see a new post on your
Expand Down
5 changes: 3 additions & 2 deletions scripts/testing/heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,13 @@ def closest_index(n, m_list, interpolate=False):

def word_aa(label, pt, fg_color, bg_color):
f = ImageFont.truetype(vera_path, pt*3)
s = f.getsize(label)
left, top, right, bottom = f.getbbox(label)
s = [right - left, bottom - top]
s = (s[0], pt*3 + 3) # getsize lies, manually compute
w_img = Image.new("RGB", s, bg_color)
w_draw = ImageDraw.Draw(w_img)
w_draw.text((0, 0), label, font=f, fill=fg_color)
return w_img.resize((s[0]//3, s[1]//3), Image.ANTIALIAS)
return w_img.resize((s[0]//3, s[1]//3), Image.LANCZOS)

def blend(percent, c1, c2):
"c1 and c2 are RGB tuples"
Expand Down

0 comments on commit 0f8e13d

Please sign in to comment.