Skip to content

Conversation

@joshuaunity
Copy link
Contributor

Description

This PR gives the functionality to edit a sensor's timezone from the UI. As well as the addition of validation for only correct timezones.

Look & Feel

Before
image

After
image

How to test

Open any sensor and modify the timezone in the form. Then confirm it edits successfully, as well as validates correctly

Further Improvements

Maybe test cases?

Related Items

This PR closes #1486

Sign-off

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on code under GPL or other license that is incompatible with FlexMeasures

@joshuaunity joshuaunity requested a review from Flix6x January 7, 2026 10:49
@joshuaunity joshuaunity self-assigned this Jan 7, 2026
@joshuaunity joshuaunity added the enhancement New feature or request label Jan 7, 2026
@read-the-docs-community
Copy link

read-the-docs-community bot commented Jan 7, 2026

Documentation build overview

📚 flexmeasures | 🛠️ Build #30942016 | 📁 Comparing 230ee61 against latest (e6592bb)


🔍 Preview build

Show files changed (4 files in total): 📝 4 modified | ➕ 0 added | ➖ 0 deleted
File Status
changelog.html 📝 modified
genindex.html 📝 modified
_autosummary/flexmeasures.data.schemas.sensors.html 📝 modified
api/v3_0.html 📝 modified

@joshuaunity joshuaunity requested a review from Flix6x January 8, 2026 19:52
@Flix6x
Copy link
Contributor

Flix6x commented Jan 8, 2026

Oddly, while testing, I'm getting a 405 Method Not Allowed on the PATCH sensor endpoint when editing the sensor in the UI. Also on main. I don't have an explanation yet. I guess it works for you @joshuaunity?

Updates:

  1. Patching does work on the 0.30.x branch. So it looks like we have a regression in the unreleased 0.31.
  2. It stopped working with Step by Step replay graph #1898.
  3. The responsible code is in ui/templates/sensors/index.html:
    document.addEventListener('DOMContentLoaded', function () => {
      const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
      tooltipTriggerList.forEach(el => new bootstrap.Tooltip(el));
    });
    
    If I remove this code (which I had added in PR Step by Step replay graph #1898 myself) the patching works again. I hate to ask, but can you please find out why? I don't get why it hinders the patch functionality.

@joshuaunity
Copy link
Contributor Author

Thanks for the find. Knowing where the issue is now, I was able to fix it.

@joshuaunity joshuaunity requested review from Flix6x and removed request for Flix6x January 9, 2026 07:52
Copy link
Contributor

@Flix6x Flix6x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! I added a changelog entry and also made some modest UX improvements to the validation logic.

@Flix6x Flix6x added this to the 0.31.0 milestone Jan 9, 2026
@Flix6x Flix6x merged commit 395a2ec into main Jan 9, 2026
8 checks passed
@Flix6x Flix6x deleted the feat/edit-sensor-timezone branch January 9, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API enhancement New feature or request UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Edit sensor timezone

4 participants